You can download this code by clicking the button below.
This code is now available for download.
This function takes a list as input and returns a new list with the elements shuffled.
Technology Stack : random.sample
Code Type : List operation
Code Difficulty : Intermediate
import random
def shuffle_list(input_list):
"""
This function takes a list as input and returns a shuffled version of the list.
"""
return random.sample(input_list, len(input_list))