Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- price_without_taxes = 0
- command = input()
- while not command == "special" and not command == "regular":
- price = float(command)
- if price < 0:
- print("Invalid price!")
- else:
- price_without_taxes += price
- command = input()
- taxes = price_without_taxes * 0.2
- total_price = price_without_taxes + taxes
- discount = 0
- if total_price == 0:
- print("Invalid order!")
- else:
- if command == "special":
- discount = total_price * 0.1
- print("Congratulations you've just bought a new computer!")
- print(f"Price without taxes: {price_without_taxes:.2f}$")
- print(f"Taxes: {taxes:.2f}$")
- print("-----------")
- print(f"Total price: {total_price - discount:.2f}$")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement