I am making 2 sets of question, first set (list1) is all yes and second (list2) is all no 10 questions each then I used random.choice to randomly pick a question from the 2 sets. I want to make an output of "correct" whenever random.choice picks a question from list 1 when the user answered "Y" same with list2 if the user answered "N". Here is my code:
import random
Count = 0
list1 = ['1+1=2?','2+2=4?','3+3=6?','4+4=8?','5+5=10?','15+15=30?','16+16=32?','17+17=34?','18+18=36?','19+19=38?']
list2 = list2 = ['20+20=10?','6+6=2?','7+7=11?','8+8=32?','9+9=21?','10+10=0?','11+11=4?','12+12=12?','13+13=25?','14+14=13?']
list = list1 + list2
while(Count < 5):
print(random.choice(list))
Answer = input("Answer: ").upper()
Count = Count+1
if(list == list1):
if(Answer == "Y"):
print("Correct")
else:
print("Incorrect")
if(list == list2):
if(Answer == "N"):
print("Correct")
else:
print("Incorrect")
I cannot figure out how to output the correct and incorrect statement. Any help would be truly appreciated.