Advertisement
bl00dt3ars

01. Match Tickets

Oct 29th, 2020
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.58 KB | None | 0 0
  1. budget = float(input())
  2. category = input()
  3. people = int(input())
  4.  
  5. if 1 <= people <= 4:
  6.   transport = budget * 0.75
  7. elif 5 <= people <= 9:
  8.   transport = budget * 0.6
  9. elif 10 <= people <= 24:
  10.   transport = budget * 0.5
  11. elif 25 <= people <= 49:
  12.   transport = budget * 0.4
  13. else:
  14.   transport = budget * 0.25
  15.  
  16. if category == "VIP":
  17.   tickets = people * 499.99
  18. else:
  19.   tickets = people * 249.99
  20.  
  21. costs = transport + tickets
  22.  
  23. if budget >= costs:
  24.   print(f"Yes! You have {budget - costs:.2f} leva left.")
  25. else:
  26.   print(f"Not enough money! You need {costs - budget:.2f} leva.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement