I want to use if condition for elements of the given list:
list = ['apple','banana','carrot']
for i in list:
if i == 'apple' or 'banana': ##Here is problem!
print i, 'pass'
The result is wrong:
apple pass
banana pass
carrot pass
It should be:
apple pass
banana pass
The no of elements to be tested in my problem are large, so looking for better way of handling it.