Advertisement
AntonStanoev

Pastry

Dec 18th, 2022 (edited)
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.22 KB | None | 0 0
  1. pastry = input()
  2. ordered_pastries = int(input())
  3. day = int(input())
  4. price_before = 0
  5. price = 0
  6. discount2 = 0
  7. discount = 0
  8.  
  9. if day <= 15:
  10.     if pastry == "Cake":
  11.         price_before = ordered_pastries * 24
  12.     if pastry == "Souffle":
  13.         price_before = ordered_pastries * 1.66
  14.     if pastry == "Baklava":
  15.         price_before = ordered_pastries * 12.60
  16. if day > 15:
  17.     if pastry == "Cake":
  18.         price_before = ordered_pastries * 28.70
  19.     if pastry == "Souffle":
  20.         price_before = ordered_pastries * 9.80
  21.     if pastry == "Baklava":
  22.         price_before = ordered_pastries * 16.98
  23.     else:
  24.         pass
  25. else:
  26.     pass
  27.  
  28. if day <= 22:
  29.     if 100 < price_before < 200:
  30.         discount = price_before * 0.15
  31.         price = price_before - discount
  32.     elif price_before > 200:
  33.         discount = price_before * 0.25
  34.         price = price_before - discount
  35.     else:
  36.         discount = 0
  37.         price = price_before - discount
  38. elif day > 22:
  39.     discount = 0
  40.     price = price_before - discount
  41. else:
  42.     pass
  43.  
  44. if day <= 15:
  45.     discount2 = price * 0.10
  46.     price = price - discount2
  47. elif day > 15:
  48.     discount2 = 0
  49.     price = price - discount2
  50. else:
  51.     pass
  52. print(f'{price:.2f}')
  53.  
  54.  
  55.  
  56.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement