Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mount = input()
- night = int(input())
- apartment = night
- studio = night
- if mount in ('May', 'October'):
- apartment *= 65
- studio *= 50
- if 7 < night <= 14:
- studio *= 0.95
- elif night > 14:
- studio *= 0.7
- elif mount in ('June', 'September'):
- apartment *= 68.7
- studio *= 75.2
- if night > 14:
- studio *= 0.8
- elif mount in ('July', 'August'):
- apartment *= 77
- studio *= 76
- if night > 14:
- apartment *= 0.9
- print(f'Apartment: {apartment:.2f} lv.\nStudio: {studio:.2f} lv.')
- РЕШЕНИЕ С ТЕРНАРЕН ОПЕРАТОР:
- mount = input()
- night = int(input())
- apartment = (65 if mount in ('May', 'October') else
- 68.7 if mount in ('June', 'September') else
- 77 if mount in ('July', 'August') else 0) * (0.9 if night > 14 else 1) * night
- studio = (50 * (0.95 if 7 < night <= 14 else 0.7 if night > 14 else 1) if mount in ('May', 'October') else
- 75.2 * (0.8 if night > 14 else 1) if mount in ('June', 'September') else
- 76 if mount in ('July', 'August') else 0) * night
- print(f'Apartment: {apartment:.2f} lv.\nStudio: {studio:.2f} lv.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement