Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #70070

Re: the logical operation confused me

From Terry Reedy <tjreedy@udel.edu>
Subject Re: the logical operation confused me
Date 2014-04-10 19:09 -0400
References <CAOmh463=QOBR4DbLDowSeqhKi_vnGtoJDwg8Lk3iiwmhqhffiQ@mail.gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.9154.1397171398.18130.python-list@python.org> (permalink)

Show all headers | View raw


On 4/10/2014 7:02 PM, length power wrote:
>  >>> "ok" or "not ok"
> 'ok'
>  >>> "ok" and "not ok"
> 'not ok'
>  >>>
>
> why "ok" or "not ok" output "ok"  , "ok" and "not ok"  output "not ok" ?

This is explained in our fine manual.
https://docs.python.org/2/reference/expressions.html#boolean-operations

-- 
Terry Jan Reedy

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: the logical operation confused me Terry Reedy <tjreedy@udel.edu> - 2014-04-10 19:09 -0400

csiph-web