Advertisement
Guest User

Fruit Shop

a guest
Apr 5th, 2020
403
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.67 KB | None | 0 0
  1. workdays = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"]
  2. weekend = ["Saturday", "Sunday"]
  3.  
  4. fruit = input()
  5. day = input()
  6. quantity = float(input())
  7.  
  8. if day == "Monday" or day == "Tuesday" or day == "Wednesday" or day == "Thursday" or day == "Friday":
  9.     banana = 2.50
  10.     apple = 1.20
  11.     orange = 0.85
  12.     grapefruit = 1.45
  13.     kiwi = 2.70
  14.     pineapple = 5.50
  15.     grapes = 3.85
  16.     total_price = 0
  17.     if fruit == "banana":
  18.         total_price = quantity * banana
  19.     elif fruit == "apple":
  20.         total_price = quantity * apple
  21.     elif fruit == "orange":
  22.         total_price = quantity * orange
  23.     elif fruit == "grapefruit":
  24.         total_price = quantity * grapefruit
  25.     elif fruit == "kiwi":
  26.         total_price = quantity * kiwi
  27.     elif fruit == "pineapple":
  28.         total_price = quantity * pineapple
  29.     elif fruit == "grapes":
  30.         total_price = quantity * grapes
  31.     print(f'{total_price:.2F}')
  32. elif day == "Saturday" or day == "Sunday":
  33.     banana = 2.70
  34.     apple = 1.25
  35.     orange = 0.90
  36.     grapefruit = 1.60
  37.     kiwi = 3
  38.     pineapple = 5.60
  39.     grapes = 4.20
  40.     total_price = 0
  41.     if fruit == "banana":
  42.         total_price = quantity * banana
  43.     elif fruit == "apple":
  44.         total_price = quantity * apple
  45.     elif fruit == "orange":
  46.         total_price = quantity * orange
  47.     elif fruit == "grapefruit":
  48.         total_price = quantity * grapefruit
  49.     elif fruit == "kiwi":
  50.         total_price = quantity * kiwi
  51.     elif fruit == "pineapple":
  52.         total_price = quantity * pineapple
  53.     elif fruit == "grapes":
  54.         total_price = quantity * grapes
  55.     print(f'{total_price:.2F}')
  56. else:
  57.     print("error")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement