a = list(range(555))
b = random.sample(a, len(a))
print('no duplicates:', a == list(set(b)))
try:
    random.sample(a, len(a) + 1)
except ValueError as e:
    print('Nope!', e)
Shuffling a list of objects in python