Sichanov

error

Jan 23rd, 2021
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.58 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.         print(f'{quantity * price:.2f}')
  9.     elif fruit == 'apple':
  10.         price = 1.20
  11.         print(f'{quantity * price:.2f}')
  12.     elif fruit == 'orange':
  13.         price = 0.85
  14.         print(f'{quantity * price:.2f}')
  15.     elif fruit == 'grapefruit':
  16.         price = 1.45
  17.         print(f'{quantity * price:.2f}')
  18.     elif fruit == 'kiwi':
  19.         price = 2.70
  20.         print(f'{quantity * price:.2f}')
  21.     elif fruit == 'pineapple':
  22.         price = 5.50
  23.         print(f'{quantity * price:.2f}')
  24.     elif fruit == 'grapes':
  25.         price = 3.85
  26.         print(f'{quantity * price:.2f}')
  27.     else:
  28.         print('error')
  29. elif day == 'Saturday' or day == 'Sunday':
  30.     if fruit == 'banana':
  31.         price = 2.70
  32.         print(f'{quantity * price:.2f}')
  33.     elif fruit == 'apple':
  34.         price = 1.25
  35.         print(f'{quantity * price:.2f}')
  36.     elif fruit == 'orange':
  37.         price = 0.90
  38.         print(f'{quantity * price:.2f}')
  39.     elif fruit == 'grapefruit':
  40.         price = 1.60
  41.         print(f'{quantity * price:.2f}')
  42.     elif fruit == 'kiwi':
  43.         price = 3.00
  44.         print(f'{quantity * price:.2f}')
  45.     elif fruit == 'pineapple':
  46.         price = 5.60
  47.         print(f'{quantity * price:.2f}')
  48.     elif fruit == 'grapes':
  49.         price = 4.20
  50.         print(f'{quantity * price:.2f}')
  51.     else:
  52.         print('error')
  53. else:
  54.     print('error')
Advertisement
Add Comment
Please, Sign In to add comment