I'm trying to compare 2 string lists in python, suppose I have this 2 lists:
list_one = ['con good', 'con good', 'tech', 'retail', 'con good',
'con good', 'retail', 'finance', 'finance', 'retail',
'retail', 'finance', 'tech', 'retail', 'tech',
'finance', 'con good', 'tech', 'con good', 'tech']
and
list_two = ['yes', 'yes', 'yes', 'no', 'no',
'no', 'no', 'yes', 'yes', 'yes',
'yes', 'yes', 'yes', 'no', 'no',
'no', 'no', 'yes', 'yes', 'no']
how to iterate a variable correctly if there is item x in index y list_one and item a index y in list_two
for example, how do I check if 'con good' in list_one is in the same position with 'yes' in list_two (both in index 0)
I tried using for loop like this
tech = 0
for i in list_one:
for j in list_two:
if i == 'tech' and j == 'yes':
tech = tech+1
print tech
but it returned 55 when it should've returned 3. Please help me