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
#!/usr/bin/python3 import random s=list(range(5)) random.shuffle(s) # << shuffle before print or assignment print(s) # print: [2, 4, 1, 3, 0]