Sichanov

dsa

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