Advertisement
Guest User

Fruit_Shop_Python

a guest
Feb 26th, 2020
1,424
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.01 KB | None | 0 0
  1. fruit = input()
  2. day = input()
  3. quantity = float(input())
  4. price = 0
  5.  
  6. if day == "Monday" or day == "Tuesday" or day == "Wednesday" or day == "Thyrsday" or day == "Friday":
  7.     if fruit == "banana":
  8.         price = 2.50
  9.     elif fruit == "apple":
  10.         price = 1.20
  11.     elif fruit == "orange":
  12.         price = 0.85
  13.     elif fruit == "grapefruit":
  14.         price = 1.45
  15.     elif fruit == "kiwi":
  16.         price = 2.70
  17.     elif fruit == "pineapple":
  18.         price = 5.50
  19.     elif fruit == "grapes":
  20.         price = 3.85
  21.     else:
  22.         print("error")
  23.  
  24. elif day == "Saturday" or day == "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. else:
  40.         print("error")
  41.  
  42. print(f"{quantity * price:.2f}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement