rounding decimals python code example
Example 1: round off float to 2 decimal places in python
answer = str(round(answer, 2))
Example 2: rounding numbers in python
>>> round(2.5)
2
answer = str(round(answer, 2))
>>> round(2.5)
2