Darlexbg

03. Fitness card

Oct 1st, 2020 (edited)
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.93 KB | None | 0 0
  1. budget = float(input())
  2. gender = input()
  3. age = int(input())
  4. sport = input()
  5.  
  6. price = 0
  7.  
  8. if gender == "m":
  9.     if sport == "Gym":
  10.         price = 42
  11.     elif sport == "Boxing":
  12.         price = 41
  13.     elif sport == "Yoga":
  14.         price = 45
  15.     elif sport == "Zumba":
  16.         price = 34
  17.     elif sport == "Dances":
  18.         price = 51
  19.     elif sport == "Pilates":
  20.         price = 39
  21. elif gender == "f":
  22.     if sport == "Gym":
  23.         price = 35
  24.     elif sport == "Boxing":
  25.         price = 37
  26.     elif sport == "Yoga":
  27.         price = 42
  28.     elif sport == "Zumba":
  29.         price = 31
  30.     elif sport == "Dances":
  31.         price = 53
  32.     elif sport == "Pilates":
  33.         price = 37
  34.  
  35. if age <= 19:
  36.     price -= price * 20 / 100
  37.  
  38. if budget >= price:
  39.     print(f"You purchased a 1 month pass for {sport}.")
  40. else:
  41.     difference = price - budget
  42.     print(f"You don't have enough money! You need ${difference:.2f} more.")
Add Comment
Please, Sign In to add comment