Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fruit, day, quantity = input(), input(), float(input())
- total_price = 0
- days_prices = {'days': [['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'], ['Saturday', 'Sunday']],
- 'prices': {"banana": [2.5, 2.7], 'apple': [1.2, 1.25], 'kiwi': [2.7, 3], 'orange': [0.85, 0.9],
- 'grapefruit': [1.45, 1.6], 'pineapple': [5.5, 5.6], 'grapes': [3.85, 4.2]}}
- if fruit in days_prices['prices']:
- if day in days_prices['days'][0]:
- total_price = quantity * days_prices['prices'][fruit][0]
- elif day in days_prices['days'][1]:
- total_price = quantity * days_prices['prices'][fruit][1]
- if total_price == 0:
- print('error')
- else:
- print(f'{total_price:.2f}')
Advertisement
Add Comment
Please, Sign In to add comment