Ddimov90

car_to_go_04_03

Oct 2nd, 2025
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.73 KB | Source Code | 0 0
  1. budget = float(input())
  2. season = input()
  3.  
  4. car_class = ""
  5. car_type = ""
  6. car_price = 0
  7.  
  8. if budget <= 100:
  9.     car_class = "Economy class"
  10.     if season == "Summer":
  11.         car_type = "Cabrio"
  12.         car_price = budget * 0.35
  13.     elif season == "Winter":
  14.         car_type = "Jeep"
  15.         car_price = budget * 0.65
  16.  
  17. elif 100 < budget <= 500:
  18.     car_class = "Compact class"
  19.     if season == "Summer":
  20.         car_type = "Cabrio"
  21.         car_price = budget * 0.45
  22.     elif season == "Winter":
  23.         car_type = "Jeep"
  24.         car_price = budget * 0.80
  25.  
  26. elif budget > 500:
  27.     car_class = "Luxury class"
  28.     car_type = "Jeep"
  29.     car_price = budget * 0.9
  30.  
  31. print(f"{car_class}")
  32. print(f"{car_type} - {car_price:.2f}")
  33.  
Advertisement
Add Comment
Please, Sign In to add comment