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 235 views
1 answer 251 views
4 answers 234 views
2 answers 189 views
4 answers 535 views
...