Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fruit = str(input())
- day = str(input())
- quantity = float(input())
- total_price = 0
- prices_week = {"banana": 2.5, 'apple': 1.2, 'kiwi': 2.7, 'orange': 0.85, 'grapefruit': 1.45, 'pineapple': 5.5,
- 'grapes': 3.85}
- prices_weekend = {"banana": 2.7, 'apple': 1.25, 'kiwi': 3, 'orange': 0.9, 'grapefruit': 1.6, 'pineapple': 5.6,
- 'grapes': 4.2}
- if fruit in prices_week:
- if day.lower() in 'mondaytuesdaywednesdaythursdayfriday':
- total_price = quantity * prices_week[fruit]
- elif day.lower() in 'saturdaysunday':
- total_price = quantity * prices_weekend[fruit]
- if total_price == 0:
- print('error')
- else:
- print(f'{total_price:.2f}')
Add Comment
Please, Sign In to add comment