Sichanov

fruit

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