Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fuel_type = input().lower()
- fuel_amount = float(input())
- discount_card = input().lower()
- fuel_price = 0
- if fuel_type == 'gas':
- fuel_price = fuel_amount * 0.93
- elif fuel_type == 'gasoline':
- fuel_price = fuel_amount * 2.22
- elif fuel_type == 'diesel':
- fuel_price = fuel_amount * 2.33
- else:
- print('Invalid fuel!')
- if discount_card == 'yes':
- if fuel_type == 'gas':
- fuel_price -= 0.08 * fuel_amount
- elif fuel_type == 'gasoline':
- fuel_price -= 0.18 * fuel_amount
- elif fuel_type == 'diesel':
- fuel_price -= 0.12 * fuel_amount
- if 20 <= fuel_amount <= 25:
- fuel_price *= 0.92
- elif fuel_amount > 25:
- fuel_price *= 0.90
- print(f'{fuel_price:.2f} lv.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement