kostovhg

fruit_shop_3

Mar 20th, 2021 (edited)
168
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. prices = {
  2.     "banana": [2.50, 2.70],
  3.     "apple": [1.20, 1.25],
  4.     "orange": [0.85, 0.90],
  5.     "grapefruit": [1.45, 1.60],
  6.     "kiwi": [2.70, 3.00],
  7.     "pineapple": [5.50, 5.60],
  8.     "grapes": [3.85, 4.20]
  9. }
  10.  
  11. days_of_the_week = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]
  12.  
  13. try:
  14.     fruit_prices = prices[input()][days_of_the_week.index(input()) // 5]
  15.     print(f"{fruit_prices * float(input()):.2f}")
  16. except (KeyError, ValueError):
  17.     print("error")
RAW Paste Data