Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def calculate_discount(student_number):
- if 10 <= student_number < 20:
- return 0.95
- elif 20 <= student_number < 50:
- return 0.85
- elif student_number >= 50:
- return 0.5
- else:
- return 1
- def main():
- season = input()
- group_type = input()
- student_number = int(input())
- nights_number = int(input())
- night_price = 0.0
- sports = ""
- discount = calculate_discount(student_number)
- if season == "Winter":
- if group_type == "boys":
- night_price = 9.60
- sports = "Judo"
- elif group_type == "girls":
- night_price = 9.60
- sports = "Gymnastics"
- elif group_type == "mixed":
- night_price = 10
- sports = "Ski"
- elif season == "Spring":
- if group_type == "boys":
- night_price = 7.20
- sports = "Tennis"
- elif group_type == "girls":
- night_price = 7.20
- sports = "Athletics"
- elif group_type == "mixed":
- night_price = 9.5
- sports = "Cycling"
- elif season == "Summer":
- if group_type == "boys":
- night_price = 15
- sports = "Football"
- elif group_type == "girls":
- night_price = 15
- sports = "Volleyball"
- elif group_type == "mixed":
- night_price = 20
- sports = "Swimming"
- price = (student_number * nights_number) * night_price
- price_discount = price * discount
- if student_number > 0 and nights_number > 0:
- print(f"{sports} {price_discount:.2f} lv.")
- if __name__ == "__main__":
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement