Sichanov

fruit shop

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