Good day coders, I have 2 lists:
A = ['yes', 'red', 'car']
B = ['yes', ['yellow', 'red'], 'car']
I am trying to take items from list A and then loop through list B and see if item-A is in list B (List B is has a nested list). i tried to use a for loop like so:
for item in A:
if item in B:
print(item,'is a correct answer.')
else:
print(item,'is a wrong answer.')
desired output 3 correct answer and the list B to be empty because after fiding a match, items from list be get popped out:
yes is a correct answer
red is a correct answer
car is a correct answer
List B = []
pardon my question structure, i am new to this. and thanks for helping =)