Sichanov

fruit shop

May 25th, 2021 (edited)
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.62 KB | None | 0 0
  1. fruit = input()
  2. day_of_week = input()
  3. quantity = float(input())
  4. price = 0
  5.  
  6. if day_of_week == "Monday" or day_of_week == "Tuesday" or day_of_week == "Wednesday" or day_of_week == "Thursday" or day_of_week == "Friday":
  7.     if fruit == "banana":
  8.         price = 2.50 * quantity
  9.         print(f"{price:.2f}")
  10.     elif fruit == "apple":
  11.         price = 1.20 * quantity
  12.         print(f"{price:.2f}")
  13.     elif fruit == "orange":
  14.         price = 0.85 * quantity
  15.         print(f"{price:.2f}")
  16.     elif fruit == "grapefruit":
  17.         price = 1.45 * quantity
  18.         print(f"{price:.2f}")
  19.     elif fruit == "kiwi":
  20.         price = 2.70 * quantity
  21.         print(f"{price:.2f}")
  22.     elif fruit == "pineapple":
  23.         price = 5.50 * quantity
  24.         print(f"{price:.2f}")
  25.     elif fruit == "grapes":
  26.         price = 3.85 * quantity
  27.         print(f"{price:.2f}")
  28. elif day_of_week == "Saturday" or day_of_week == "Sunday":
  29.     if fruit == "banana":
  30.         price = 2.70 * quantity
  31.         print(f"{price:.2f}")
  32.     elif fruit == "apple":
  33.         price = 1.25 * quantity
  34.         print(f"{price:.2f}")
  35.     elif fruit == "orange":
  36.         price = 0.90 * quantity
  37.         print(f"{price:.2f}")
  38.     elif fruit == "grapefruit":
  39.         price = 1.60 * quantity
  40.         print(f"{price:.2f}")
  41.     elif fruit == "kiwi":
  42.         price = 3.00 * quantity
  43.         print(f"{price:.2f}")
  44.     elif fruit == "pineapple":
  45.         price = 5.60 * quantity
  46.         print(f"{price:.2f}")
  47.     elif fruit == "grapes":
  48.         price = 4.20 * quantity
  49.         print(f"{price:.2f}")
  50. if price == 0:
  51.     print("error")
  52. else:
  53.     print(f'{price:.2f}')
Add Comment
Please, Sign In to add comment