Sichanov

fruit shop

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