You can download this code by clicking the button below.
This code is now available for download.
This function takes a list as an argument and then uses the shuffle function from the random module to shuffle the items in the list in-place, and finally returns the shuffled list.
Technology Stack : random module
Code Type : Function
Code Difficulty : Intermediate
import random
def shuffle_list(items):
"""
Shuffle the items in the list in-place.
"""
random.shuffle(items)
return items