Facebook
From GKiroff, 2 Years ago, written in Python.
Embed
Download Paste or View Raw
Hits: 121
  1. fruit = input()
  2. day_of_week = input()
  3. quantity = float(input())
  4.  
  5. price = 0
  6.  
  7. if day_of_week == "Monday" or "Tuesday" or "Wednesday" or "Thursday" or "Friday":
  8.     if fruit == "banana":
  9.         price = 2.5
  10.     elif fruit == "apple":
  11.         price = 1.2
  12.     elif fruit == "orange":
  13.         price = 0.85
  14.     elif fruit == "grapefruit":
  15.         price = 1.45
  16.     elif fruit == "kiwi":
  17.         price = 2.7
  18.     elif fruit == "pineapple":
  19.         price = 5.5
  20.     elif fruit == "grapes":
  21.         price = 3.85
  22.  
  23. if day_of_week == "Saturday" or "Sunday":
  24.     if fruit == "banana":
  25.         price = 2.7
  26.     elif fruit == "apple":
  27.         price = 1.25
  28.     elif fruit == "orange":
  29.         price = 0.9
  30.     elif fruit == "grapefruit":
  31.         price = 1.60
  32.     elif fruit == "kiwi":
  33.         price = 3.00
  34.     elif fruit == "pineapple":
  35.         price = 5.6
  36.     elif fruit == "grapes":
  37.         price = 4.2
  38. if price == 0.00:
  39.     print("error")
  40.  
  41. sum = (f'{price * quantity:.2f}')
  42. print(sum)
  43.