In Python 3, range returns a lazy sequence object - it does not return a list. It is not possible to reorder items in a range object, so it cannot be shuffled.
Convert it to a list before shuffling.
allocations = list(range(len(people)))
source share