random.shuffle should work. Here’s an example, where the objects are lists:
from random import shuffle x = [[i] for i in range(10)] shuffle(x) print(x) # print(x) gives [, , , , , , , , , ]
shuffle works in place, and returns
More generally in Python, mutable objects can be passed into functions, and when a function mutates those objects, the standard is to return
None (rather than, say, the mutated object).