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