📜  python联合洗牌 - Python代码示例

📅  最后修改于: 2022-03-11 14:45:09.676000             🧑  作者: Mango

代码示例1
import random

a = ['a', 'b', 'c']
b = [1, 2, 3]

c = list(zip(a, b))

random.shuffle(c)

a, b = zip(*c)

print a
print b

[OUTPUT]
['a', 'c', 'b']
[1, 3, 2]