Ddimov90

match_tickets _01_03

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