I have to make a quiz for a project. I have the question and 3 answers but the correct one always come on the top. How do I shuffle my answers?
QS = []
for row in data:
row.append(2)
QS.append(row)
while True:
x=random.randint(0,len(QS)-1)
if QS[x][2]>0:
print QS[x][0]
break
while True:
if QS[x][2]>0:
print QS[x][1]
break
while True:
xy=random.randint(0,len(QS)-1)
if xy!=x:
print QS[xy][1]
break
while True:
xyz=random.randint(0,len(QS)-1)
if xyz!=xy and xyz!=xy:
print QS[xyz][1]
break