Answer the question
In order to leave comments, you need to log in
Help with the solution of the problem taken from the book Getting Started Programming in Python | Gaddis Tony?
I want to check the correctness of my code
The task itself:
My code:
purchase_amount = int(input('Введите величину вашей покупки: '))
FEDERAL_TAX = 0.005 * purchase_amount
REGIONAL_TAX = 0.025 * purchase_amount
ALL_TAX = FEDERAL_TAX + REGIONAL_TAX
print("Ваша сумма покупки составляет:",purchase_amount)
print('Федеральный налог с продаж составляет:',FEDERAL_TAX)
print('Региональный налог с продаж составляет:',REGIONAL_TAX)
print('Общий налог с продаж составляет:',ALL_TAX)
print('Общая сумма продаж составляет:', purchase_amount+ALL_TAX)
Answer the question
In order to leave comments, you need to log in
In general, everything seems to be correct, the only thing was a typo with the calculation of the federal tax, you have it 0.005, when it should be 0.05
Are you going to drag here every 10 lines? Maybe read it first?
PS You need to start with Lutz.
PPS
print(
f"Ваша сумма покупки составляет:{purchase_amount}",
f"Федеральный налог с продаж составляет:{FEDERAL_TAX}",
f"Региональный налог с продаж составляет:{REGIONAL_TAX}",
f"Общий налог с продаж составляет:{ALL_TAX}",
f"Общая сумма продаж составляет:{PURCHASE_WITH_TAX}",
sep='\n'
)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question