You can download this code by clicking the button below.
This code is now available for download.
This function is used to shuffle the elements of a list
Technology Stack : random
Code Type : Function
Code Difficulty : Beginner
import random
def shuffle_list(items):
if not isinstance(items, list):
raise TypeError("items must be a list")
random.shuffle(items)
return items