Randomize elements in list in Python

shuffle() methods randomizes the elements in the list. Shuffle method is available in random module.

syntax : random.shuffle(list)


Example:
import random
list = [10,20,30,40,50];
random.shuffle(list)
print(list)
Output:
[50, 20, 40, 10, 30]


Example with strings
import random
cloud_providers = ["Google cloud platform","Amazon web services","Microsoft Azure","Oracle Cloud","Openstack"];
random.shuffle(cloud_providers)
print(cloud_providers)