Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- total_price_without_taxes = 0
- customer_type = ""
- while True:
- input_data = input()
- if input_data == "special" or input_data == "regular":
- customer_type = input_data
- break
- price = float(input_data)
- if price <= 0:
- print("Invalid price!")
- continue
- tax = 0.2 * price
- total_price_without_taxes += price
- if total_price_without_taxes == 0:
- print("Invalid order!")
- else:
- print("Congratulations you've just bought a new computer!")
- print(f"Price without taxes: {total_price_without_taxes:.2f}$")
- print(f"Taxes: {total_price_without_taxes * 0.2:.2f}$")
- print("-----------")
- total_price_with_taxes = total_price_without_taxes + (total_price_without_taxes * 0.2)
- if customer_type == "special":
- total_price_with_taxes -= (total_price_with_taxes * 0.10)
- print(f"Total price: {total_price_with_taxes:.2f}$")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement