Sichanov

hh

Apr 20th, 2021
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.09 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 \
  7.                               day_of_week == " Thursday" or day_of_week == "Friday":
  8.     if fruit == "banana":
  9.         price = 2.50
  10.     if fruit == "apple":
  11.         price = 1.20
  12.     if fruit == "orange":
  13.         price = 0.80
  14.     if fruit == "grapefruit":
  15.         price = 1.45
  16.     if fruit == "kiwi":
  17.         price = 2.70
  18.     if fruit == "pineapple":
  19.         price = 5.50
  20.     if fruit == "grapes":
  21.         price = 3.85
  22. elif day_of_week == "Saturday" or day_of_week == "Sunday":
  23.     if fruit == "banana":
  24.         price = 2.70
  25.     if fruit == "apple":
  26.         price = 1.25
  27.     if fruit == "orange":
  28.         price = 0.90
  29.     if fruit == "grapefruit":
  30.         price = 1.60
  31.     if fruit == "kiwi":
  32.         price = 3.00
  33.     if fruit == "pineapple":
  34.         price = 5.60
  35.     if fruit == "grapes":
  36.         price = 4.20
  37. if price == 0:
  38.     print('error')
  39. else:
  40.     final_price = quantity * price
  41.     print(f"{final_price:.2f}")
Advertisement
Add Comment
Please, Sign In to add comment