I was trying to test how the lists in python works according to a tutorial I was reading. When I tried to use list.sort() or list.reverse(), the in
list.sort()
list.reverse()
This methods operate in place.
This code works (python 3.x)
a = [66.25, 333, 333, 1, 1234.5] a.sort() print(a) a.reverse() print(a) >>> [1, 66.25, 333, 333, 1234.5] [1234.5, 333, 333, 66.25, 1]