boolian logic

Roel Schroeven rschroev_nospam_ml at fastmail.fm
Fri Jun 13 12:20:27 CEST 2008


marc wyburn schreef:
> HI all, I'm a bit stuck with how to work out boolian logic.
> 
> I'd like to say if A is not equal to B, C or D:
>    do something.
> 
> I've tried
> 
> if not var == A or B or C:
> and various permutations but can't seem to get my head around it.  I'm
> pretty sure I need to know what is calulated first i.e the not or the
> 'OR/AND's

if var not in (A, B, C):
   do_something()

-- 
The saddest aspect of life right now is that science gathers knowledge
faster than society gathers wisdom.
   -- Isaac Asimov

Roel Schroeven



More information about the Python-list mailing list