round to specific decimal python code example
Example 1: python print 2 decimal places
# this will print up to digits after decimal
print("%.2f" % (70/105))
Example 2: round off float to 2 decimal places in python
answer = str(round(answer, 2))
# this will print up to digits after decimal
print("%.2f" % (70/105))
answer = str(round(answer, 2))