Shuffling List in Python

Python Code to Shuffle a list randomly.

Source code :

import random

items = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
random.shuffle(items)
print(items)

Output :

[4, 3, 2, 10, 5, 1, 9, 7, 6, 8]

Output :


                

Comments :