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
It took me some time to get that too. But the documentation for shuffle is very clear:
shuffle list x in place; return None.
So you shouldn't print(random.shuffle(b)). Instead do random.shuffle(b) and then print(b).
print(random.shuffle(b))
random.shuffle(b)
print(b)