How to round a list of floats into integers in Python

1 Answer

0 votes
lst = [7.16983, 3.817, 2.981, 5.5001, 8.295]

lst = [round(item) for item in lst]

print(lst)






'''
run:
 
[7, 4, 3, 6, 8]
 
'''

 



answered Jul 15, 2022 by avibootz

Related questions

4 answers 275 views
2 answers 140 views
1 answer 201 views
2 answers 243 views
...