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 then uses the sample method from the random module to shuffle the order of the elements in the list and return it.
Technology Stack : Random
Code Type : Function
Code Difficulty : Intermediate
import random
def shuffle_list(input_list):
"""
随机打乱列表中的元素顺序。
"""
return random.sample(input_list, len(input_list))