Advertisement
Spocoman

Fitness Card

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