How to round a number in Python

The round() function rounds a given number with the specified number of decimals.

If you don’t specify the number of decimals, the default will be zero decimals.

print(round(32.8476))

print(round(32.8476,1))

print(round(32.8476,2))

print(round(32.8476,3))
33
32.8
32.85
32.848