Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fruit = str(input())
- day = str(input())
- quantity = float(input())
- days = [['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'], ['Saturday', 'Sunday']]
- total_price = 0
- 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 prices:
- if day in days[0]:
- total_price = quantity * prices[fruit][0]
- elif day in days[1]:
- total_price = quantity * prices[fruit][1]
- if total_price == 0:
- print('error')
- else:
- print(f'{total_price:.2f}')
Advertisement
Add Comment
Please, Sign In to add comment