Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- budget = float(input())
- season = input()
- car = ''
- car_class = ''
- if budget > 500:
- car = 'Jeep'
- car_class = 'Luxury class'
- budget = 0.9 * budget
- elif 100 < budget <= 500:
- if season == 'Summer':
- car = 'Cabrio'
- budget = 0.45 * budget
- else:
- car = 'Jeep'
- budget = 0.8 * budget
- car_class = 'Compact class'
- elif 0 < budget <= 100:
- if season == 'Summer':
- car = 'Cabrio'
- budget = 0.35 * budget
- else:
- car = 'Jeep'
- budget = 0.65 * budget
- car_class = 'Economy class'
- print(car_class)
- print(f'{car} - {budget:.2f}')
- И малко по-съкратен вариант:
- budget = float(input())
- season = input()
- car = 'Jeep'
- car_class = 'Luxury class'
- if budget > 500:
- budget *= 0.9
- elif 100 < budget <= 500:
- if season == 'Summer':
- car = 'Cabrio'
- budget *= 0.45
- else:
- budget *= 0.8
- car_class = 'Compact class'
- elif 0 < budget <= 100:
- if season == 'Summer':
- car = 'Cabrio'
- budget *= 0.35
- else:
- budget *= 0.65
- car_class = 'Economy class'
- print(f'{car_class}\n{car} - {budget:.2f}')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement