[Tutor] why does this fail

Steven D'Aprano steve at pearwood.info
Wed Aug 25 23:09:14 CEST 2010


On Thu, 26 Aug 2010 04:18:28 am Greg Bair wrote:
> I'm assuming what you really want is :
>
> if letter in strng:
>     print "true"
> else:
>     print "false"

Oh I hope not... the above is better written as:

print letter in strng

(assuming you don't care about the difference between "True" 
and "true").



-- 
Steven D'Aprano


More information about the Tutor mailing list