How to round a float to 2 decimal places in Python

1 Answer

0 votes
result = round(3.567, 2)
print(result)  

print(round(3.555, 2))  

print(round(3.419, 2))  


print(round(3.234, 2))  




'''
run:

3.57
3.56
3.42
3.23

'''

 



answered Jul 16, 2022 by avibootz

Related questions

2 answers 253 views
1 answer 266 views
4 answers 273 views
2 answers 207 views
4 answers 561 views
...