What are the syntax for &&, ||

Peter Otten __peter__ at web.de
Wed Oct 22 23:25:08 CEST 2008


RC wrote:

> if condition1 && condition2: # and
>         doThis
> elif condition3 || condition4: # or
>         doThat
 
> In most of language have &&, ||
> 
> How do I do in Python?

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

See the pattern?



More information about the Python-list mailing list