# 要求打乱一个有序列表 # 待处理列表 L1 = [11,22,33,44,55,66,77,] 方法: # 引入random模块,该模块的shuffle方法见下图 import random L1 = [11,22,33,44,55,66,77,] print(L1) print('-------------------') random.shu
# 待处理列表
L1 = [11,22,33,44,55,66,77,]
方法:
# 引入random模块,该模块的shuffle方法见下图import random
L1 = [11,22,33,44,55,66,77,]
print(L1)
print('-------------------')
random.shuffle(L1)
print(L1)
random模块下shuffle方法的介绍