a = [['jimmy', '25', 'pancakes'], ['tom', '23', 'brownies'], ['harry', '21', 'cookies']]
for i in range(len(a)):
if (a[i][1] == '20' or a[i][1] == '26'):
print 'yes'
else:
print 'Not found'
This output's Not found three times. If the output of the every iteration of the if loop is the same, I want it to iterate over the entire list and then print Not found only once.
If I change a[i][1] == '25' and the output becomes:
yes
Not found
Not found
I want to print yes but not Not found.