Kent Johnson wrote:
> Hans Fangohr wrote:
> 
>> In [2]: 2 in [1,2,3] == True

On a slightly different tangent from the other answers you've received 
to this question, if you're using a conditional expression, don't 
compare it explicitly with True or False, just state the condition:

if 2 in [1,2,3]:
   blah

The same holds even if a variable contains True or False:

some_option = True
...
if some_option:
   blah

NOT:

if some_option == True:
   blah

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to