Python: shuffle list

YURII DE. - Aug 12 '22 - - Dev Community

import random

number_list = [1, 2, 3, 4, 5]
print ("Original list: ",  number_list)

random.shuffle(number_list) #shuffle method
print ("Shuffle list: ",  number_list)

Enter fullscreen mode Exit fullscreen mode
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .