Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def calculate_price(num_people, season):
- if season == "spring":
- price_per_person = 50
- elif season == "summer":
- price_per_person = 45
- elif season == "autumn":
- price_per_person = 49.50
- elif season == "winter":
- price_per_person = 85
- total_price = price_per_person * num_people
- if season == "summer":
- total_price *= 0.85 # 15% отстъпка
- elif season == "winter":
- total_price *= 1.08 # 8% оскъпяване
- return "{:.2f} leva.".format(total_price)
- num_people = int(input())
- season = input()
- price = calculate_price(num_people, season)
- print(price)
Advertisement
Add Comment
Please, Sign In to add comment