[Tutor] Very basic question about lists

Steve Willoughby steve at alchemy.com
Tue Dec 23 01:01:31 CET 2008


>>    if 'ar' or 'ko' in item:

This is incorrect.  What you meant to say was:

if 'ar' in item or 'ko' in item:

or something equivalent to that.

"if 'ar' or 'ko' in item" means "if ('ar') is True or ('ko' in item) is 
True".  Since 'ar' is True anyway, you'll get a match every time.


More information about the Tutor mailing list