def shufflemode():
import random
combined = zip(question, answer)
random.shuffle(combined)
question[:], answer[:] = zip(*combined)
但随后我收到错误: 类型错误:“zip”类型的对象没有 len()
我该怎么办,我很困惑
最佳答案
我也想知道同样的事情。根据: randomizing two lists and maintaining order in python 你应该能够像OP尝试的那样做到这一点,但我也得到同样的错误。我认为链接中的使用的是 python 2 而不是 3,这可能是问题所在吗?
关于zip - python 中压缩时出现 LEN 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18048310/