if statement multiple or

Chris Rebert clp2 at rebertia.com
Fri May 6 07:08:33 EDT 2011


On Fri, May 6, 2011 at 4:02 AM, Albert Hopkins <marduk at letterboxes.org> wrote:
> On Fri, 2011-05-06 at 13:47 +0300, Lutfi Oduncuoglu wrote:
>> Hi,
>>
>> I am trying to write a script and I realised that I need to use
>> something like
>>
>> if ('a' or 'b' or 'c')  not in line:
>>    print line
>>
>
> The expression:
>    ('a' or 'b' or 'c')
>
> evaluates to True

Not quite:

$ python
Python 2.6.6 (r266:84292, Jan 12 2011, 13:35:00)
>>> 'a' or 'b' or 'c'
'a'
>>>

Cheers,
Chris



More information about the Python-list mailing list