Advertisement
pacho_the_python

Untitled

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