DEV Community

YURII DE.
YURII DE.

Posted on

Python: shuffle list


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

Top comments (0)