Advertisement
Hristomir

fruit_shop

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