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 shuffles the order of its elements using the shuffle method from the random module.
Technology Stack : random
Code Type : Function
Code Difficulty : Intermediate
import random
def shuffle_list(items):
"""
随机打乱列表中元素顺序的函数。
"""
random.shuffle(items)
return items