How to randomize a list in Python

Randomizing a list shuffles the order of elements in that list. For example, randomizing [1, 2, 3] might result in [2, 1, 3].

Solution for How to randomize a list in Python : You can use random.shuffle() to randomize a list Call random.shuffle(x) to randomize the order of the elements in x.


how-to-randomize-a-list-in-python