Advertisement
Nenogzar

Untitled

Sep 20th, 2023
1,886
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.65 KB | None | 0 0
  1. def calculate_discount(student_number):
  2.     if 10 <= student_number < 20:
  3.         return 0.95
  4.     elif 20 <= student_number < 50:
  5.         return 0.85
  6.     elif student_number >= 50:
  7.         return 0.5
  8.     else:
  9.         return 1
  10.  
  11. def main():
  12.     season = input()
  13.     group_type = input()
  14.     student_number = int(input())
  15.     nights_number = int(input())
  16.  
  17.     night_price = 0.0
  18.     sports = ""
  19.     discount = calculate_discount(student_number)
  20.  
  21.     if season == "Winter":
  22.         if group_type == "boys":
  23.             night_price = 9.60
  24.             sports = "Judo"
  25.         elif group_type == "girls":
  26.             night_price = 9.60
  27.             sports = "Gymnastics"
  28.         elif group_type == "mixed":
  29.             night_price = 10
  30.             sports = "Ski"
  31.     elif season == "Spring":
  32.         if group_type == "boys":
  33.             night_price = 7.20
  34.             sports = "Tennis"
  35.         elif group_type == "girls":
  36.             night_price = 7.20
  37.             sports = "Athletics"
  38.         elif group_type == "mixed":
  39.             night_price = 9.5
  40.             sports = "Cycling"
  41.     elif season == "Summer":
  42.         if group_type == "boys":
  43.             night_price = 15
  44.             sports = "Football"
  45.         elif group_type == "girls":
  46.             night_price = 15
  47.             sports = "Volleyball"
  48.         elif group_type == "mixed":
  49.             night_price = 20
  50.             sports = "Swimming"
  51.  
  52.  
  53.  
  54.     price = (student_number * nights_number) * night_price
  55.     price_discount = price * discount
  56.  
  57.     if student_number > 0 and nights_number > 0:
  58.         print(f"{sports} {price_discount:.2f} lv.")
  59.  
  60. if __name__ == "__main__":
  61.     main()
Tags: scool camp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement