I have a list of objects and I want to shuffle them. I thought I could use the random.shuffle method, but this seems to fail when the list is of objects. Is the
random.shuffle
import random class a: foo = "bar" a1 = a() a2 = a() a3 = a() a4 = a() b = [a1,a2,a3,a4] random.shuffle(b) print(b)
shuffle is in place, so do not print result, which is None, but the list.
shuffle
None