Advertisement
ChynaBG

Fruit Shop

Feb 26th, 2020
1,607
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().lower()
  2. day = input()
  3. quantity = float(input())
  4. price = 0
  5.  
  6.  
  7. if day == 'Saturday' or day == 'Sunday':
  8.     if fruit == 'banana':
  9.         price = 2.70
  10.     elif fruit == 'apple':
  11.         price = 1.25
  12.     elif fruit == 'orange':
  13.         price = 0.90
  14.     elif fruit == 'grapefruit':
  15.         price = 1.60
  16.     elif fruit == 'kiwi':
  17.         price = 3.00
  18.     elif fruit == 'pineapple':
  19.         price = 5.60
  20.     elif fruit == 'grapes':
  21.         price = 4.20
  22. elif day == 'Monday' or day == 'Tuesday' or day == 'Wednesday' or day == 'Thursday' or day == 'Friday':
  23.     if fruit == 'banana':
  24.         price = 2.50
  25.     elif fruit == 'apple':
  26.         price = 1.20
  27.     elif fruit == 'orange':
  28.         price = 0.85
  29.     elif fruit == 'grapefruit':
  30.         price = 1.45
  31.     elif fruit == 'kiwi':
  32.         price = 2.70
  33.     elif fruit == 'pineapple':
  34.         price = 5.50
  35.     elif fruit == 'grapes':
  36.         price = 3.85
  37.  
  38.  
  39.  
  40. if price == 0.00:
  41.     print('error')
  42. else:
  43.     print(f'{price * quantity:.2f}')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement