Advertisement
Spocoman

Car To Go

Jan 6th, 2022
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.59 KB | None | 0 0
  1. budget = float(input())
  2. season = input()
  3. car = ''
  4. classs = ''
  5.  
  6. if budget > 500:
  7.     car = 'Jeep'
  8.     budget *= 0.9
  9.     classs = 'Luxury class'
  10.    
  11. elif 100 < budget <= 500:
  12.     if season == 'Summer':
  13.         car = 'Cabrio'
  14.         budget *= 0.45
  15.     else:
  16.         car = 'Jeep'
  17.         budget *= 0.8
  18.        
  19.     classs = 'Compact class'
  20.  
  21. elif 0 < budget <= 100:
  22.     if season == 'Summer':
  23.         car = 'Cabrio'
  24.         budget *= 0.35
  25.     else:
  26.         car = 'Jeep'
  27.         budget *= 0.65
  28.        
  29.     classs = 'Economy class'
  30.  
  31. print(classs)
  32. print(f'{car} - {budget:.2f}')
  33.  
  34.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement