#to round floats in Python you can use the "round" function. ex: tax = 34.4563 tax = round(tax, 2) #the number 2 at the end is how many digits are rounded. #the variable "tax" would now be: 34.46
Here is what the above code is Doing:
1. Creating a variable called “tax” and assigning it the value 34.4563
2. Using the “round” function to round the value of “tax” to 2 decimal places
3. Assigning the rounded value of “tax” back to the “tax” variable
4. Printing the value of “tax”