Answers for "round values in list python"

4

round python with list

a_list = [1.234, 2.345, 3.45, 1.45]
round_to_whole = [round(num) for num in a_list]

print(round_to_whole)
Posted by: Guest on September-11-2020
0

round list of floats python

myList = [round(x) for x in myList]

myList # [25, 193, 282, 88, 80, 450, 306, 282, 88, 676, 986, 306, 282]
Posted by: Guest on May-02-2020

Python Answers by Framework

Browse Popular Code Answers by Language