Hi, newbie to python here, I just wanted to ask how I can compute the after tax price and displaying only up to 2 decimal places. Like 4.1895030939393 will display only 4.18 without it rounding.

Here's what I've done so far

Original_Price = float(input('Please input the before-tax price : '))
Final_Price = (1.05*Original_Price)
print("Your total including tax is", Final_Price)

u can use the python built in function round()

Original_Price = float(input('Please input the before-tax price : '))
Final_Price = (1.05*Original_Price)
print("Your total including tax is", round(Final_Price, 2) )

you can find out more about it here

There is also format()

>>> p = 4.1895030939393
>>> print("Your total including tax is {:.2f}.".format(p))
Your total including tax is 4.19.
This question has already been answered. Start a new discussion instead.