Andonoff

Fruit_Shop

Jan 19th, 2025
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.63 KB | None | 0 0
  1. product = input()
  2. day_of_week = input()
  3. quantity = float(input())
  4.  
  5. working_days = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"]
  6. weekend = ["Saturday", "Sunday"]
  7.  
  8. fruit_prices = {
  9.     "banana": [2.50, 2.70],
  10.     "apple": [1.20, 1.25],
  11.     "orange": [0.85, 0.90],
  12.     "grapefruit": [1.45, 1.60],
  13.     "kiwi": [2.70, 3.00],
  14.     "pineapple": [5.50, 5.60],
  15.     "grapes": [3.85, 4.20]
  16. }
  17.  
  18. if day_of_week in working_days and product in fruit_prices:
  19.     print(f"{fruit_prices[product][0] * quantity:.2f}")
  20. elif day_of_week in weekend and product in fruit_prices:
  21.     print(f"{fruit_prices[product][1] * quantity:.2f}")
  22. else:
  23.     print("error")
  24.  
Add Comment
Please, Sign In to add comment