Advertisement
Spocoman

PastryShop

Feb 13th, 2022
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.46 KB | None | 0 0
  1. product = input()
  2. quantity = int(input())
  3. date = int(input())
  4.  
  5. price = {"Cake": {date <= 15: 24, date > 15: 28.70},
  6.          "Souffle": {date <= 15: 6.66, date > 15: 9.80},
  7.          "Baklava": {date <= 15: 12.60, date > 15: 16.98}}
  8.  
  9. total = quantity * price[product][True]
  10.  
  11. if date <= 22:
  12.     if 100 <= total <= 200:
  13.         total *= 0.85
  14.     elif total > 200:
  15.         total *= 0.75
  16.        
  17. if date <= 15:
  18.     total *= 0.9
  19.    
  20. print(f"{total:.2f}")
  21.  
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement