Advertisement
Guest User

Untitled

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