I am a beginner programmer and this is a small program. I want my final output variable per_person
to have exactly 2 decimal places. Why is this not happening with my code?
When I write that the total bill is 150 and the number of people is 5, the final answer is 33,6, however I want it to be 33,60.
bill = input("Can you tell us how much is the total bill?: ")
final_bill = int(bill) * 1.12
print(type(final_bill))
number_of_people = input("How many people are we?: ")
per_person = round(final_bill / int(number_of_people), 2)
print(per_person)
I expected that by printing the per_person
variable I would get something with 2 decimal places, however it is always one.