How to round off all the elements of a list in python code example
Example: how to round the values in a 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)
a_list = [1.234, 2.345, 3.45, 1.45]
round_to_whole = [round(num) for num in a_list]
print(round_to_whole)