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)
mylist = [0.30000000000000004, 0.5, 0.20000000000000001] myRoundedList = [round(x,2) for x in mylist] # [0.3, 0.5, 0.2]