What are the syntax for &&, ||

Andrew Koenig ark at acm.org
Tue Nov 25 17:11:06 EST 2008


"Peter Otten" <__peter__ at web.de> wrote in message 
news:gdo5nh$eio$03$1 at news.t-online.com...

>> How do I do in Python?

> if condition1 and condition2: # &&
> doThis
> elif condition3 or condition4: # ||
> doThat

> See the pattern?

if condition1 and condition2:
    doThis
elif condition3 or condition4:
    doThat





More information about the Python-list mailing list