George_Ivanov05

01. Match Tickets

Mar 3rd, 2021
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.19 KB | None | 0 0
  1. budget = float(input())
  2. category = input()
  3. people = int(input())
  4.  
  5. category_price = 0
  6. transport_price = 0
  7.  
  8. if category == "VIP":
  9.     category_price = 499.99 * people
  10.     if people <= 4:
  11.         transport_price = budget * 0.75
  12.     elif 5 <= people <= 9:
  13.         transport_price = budget * 0.60
  14.     elif 10 <= people <= 24:
  15.         transport_price = budget * 0.50
  16.     elif 25 <= people <= 49:
  17.         transport_price = budget * 0.40
  18.     elif people >= 50:
  19.         transport_price = budget * 0.40
  20. elif category_price == "Normal":
  21.     category_price = 249.99 * people
  22.     if people <= 4:
  23.         transport_price = budget * 0.75
  24.     elif 5 <= people <= 9:
  25.         transport_price = budget * 0.60
  26.     elif 10 <= people <= 24:
  27.         transport_price = budget * 0.50
  28.     elif 25 <= people <= 49:
  29.         transport_price = budget * 0.40
  30.     elif people >= 50:
  31.         transport_price = budget * 0.40
  32.  
  33. if budget >= transport_price + category_price:
  34.     money_left = budget - transport_price + category_price
  35.     print(f"Yes! You have {money_left:.2f} leva left.")
  36. else:
  37.     money_need = (transport_price + category_price) - budget
  38.     print(f"Not enough money! You need {money_need:.2f} leva.")
Advertisement
Add Comment
Please, Sign In to add comment