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