BdW44222

01. Computer Store

Jul 7th, 2021
978
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. prices = input()
  2. total_price = 0
  3.  
  4. while not (prices == "special" or prices == "regular"):
  5.     current_price = float(prices)
  6.     if current_price <= 0:
  7.         print("Invalid price!")
  8.     else:
  9.         total_price += current_price
  10.     prices = input()
  11.  
  12. if total_price == 0:
  13.     print("Invalid order!")
  14. else:
  15.     print("Congratulations you've just bought a new computer!")
  16.     print(f"Price without taxes: {total_price:.2f}$")
  17.     taxes = total_price * 0.2
  18.     print(f"Taxes: {taxes:.2f}$")
  19.     print("-----------")
  20.     total = total_price + taxes
  21.     if prices == "special":
  22.         total -= total * 0.1
  23.     print(f"Total price: {total:.2f}$")
RAW Paste Data