mercredi 14 juillet 2021

random shuffle always return None

i only get None after running random.shuffle in python

a = [(6, 7), (6, 5), (7, 4), (4, 4), (9, 8)]
print(f'{a=}')
x = random.shuffle(a)
print(f'{x=}')

>>> a = [(6, 7), (6, 5), (7, 4), (4, 4), (9, 8)]
>>> None



Aucun commentaire:

Enregistrer un commentaire