This thread explained how to iterate through two parallel lists.
When I apply that lesson to a shuffled list, however, I get the following error: "zip argument #2 does not support iteration." Why does a shuffled list not support iteration? How else can I randomize the order of answer choices?
import random
def answers():
answerList = random.shuffle([answer1, answer2, answer3, correct])
numberList = ["1: ", "2: ", "3: ", "4: "]
for x,y in zip(numberList,answerList):
print x,y
prompt = "What is the average migrating speed of a laden swallow?"
answer1 = "Gas or electric?"
answer2 = "Metric or English?"
answer3 = "Paper or plastic?"
correct = "African or European?"
print prompt
answers()