Sichanov

match_tickets

May 21st, 2021
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.83 KB | None | 0 0
  1. budget = float(input())
  2. category = input()
  3. count_of_people = int(input())
  4. have_budget = True
  5. transport = 0
  6. available_money = 0
  7.  
  8. if 1 <= count_of_people <= 4:
  9.     transport = budget * 0.75
  10. elif 5 <= count_of_people <= 9:
  11.     transport = budget * 0.60
  12. elif 10 <= count_of_people <= 24:
  13.     transport = budget * 0.50
  14. elif 25 <= count_of_people <= 49:
  15.     transport = budget * 0.40
  16. elif count_of_people >= 50:
  17.     transport = budget * 0.25
  18. if category == "VIP":
  19.     ticket_price = count_of_people * 499.99
  20. else:
  21.     ticket_price = count_of_people * 249.99
  22.  
  23. total_price = transport + ticket_price
  24.  
  25. if budget >= total_price:
  26.     money_left = budget - total_price
  27.     print(f"Yes! You have {money_left:.2f} leva left.")
  28. else:
  29.     needed_money = total_price - budget
  30.     print(f"Not enough money! You need {needed_money:.2f} leva.")
Advertisement
Add Comment
Please, Sign In to add comment