I have a list which consists of float values but they\'re too detailed to proceed. I know we can shorten them by using the (\"%.f\" % variable) operator, like:
(\"%.f\" % variable)
If you really want an iterator-free solution, you can use numpy and its array round function.
import numpy as np myList = list(np.around(np.array(myList),2))