Advertisement
Guest User

Untitled

a guest
Oct 3rd, 2019
495
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.11 KB | None | 0 0
  1. fruit = input()
  2. week_day = input()
  3. quantity = float(input())
  4.  
  5. price = 0
  6. if week_day == 'Monday' \
  7.         or week_day == 'Tuesday' \
  8.         or week_day == 'Wednesday' \
  9.         or week_day == 'Thursday' \
  10.         or week_day ==  'Friday':
  11.     if fruit == 'banana':
  12.         price == 2.5
  13.     elif fruit == 'apple':
  14.         price = 1.2
  15.     elif fruit == 'orange':
  16.         price = 0.85
  17.     elif fruit == 'grapefruit':
  18.         price = 1.45
  19.     elif fruit == 'kiwi':
  20.         price = 2.7
  21.     elif fruit == 'pineapple':
  22.         price = 5.5
  23.     elif fruit == 'grapes':
  24.         price = 3.85
  25. elif week_day == 'Saturday' or week_day == 'Sunday':
  26.     if fruit == 'banana':
  27.         price == 2.7
  28.     elif fruit == 'apple':
  29.         price = 1.25
  30.     elif fruit == 'orange':
  31.         price = 0.90
  32.     elif fruit == 'grapefruit':
  33.         price = 1.6
  34.     elif fruit == 'kiwi':
  35.         price = 3
  36.     elif fruit == 'pineapple':
  37.         price = 5.6
  38.     elif fruit == 'grapes':
  39.         price = 4.2
  40.  
  41.  
  42. if price == 0:
  43.     print('error')
  44. else:
  45.     total_price = quantity * price
  46.     print(f'{total_price:.2f}')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement