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


Groups > comp.lang.python > #108135

Re: Conditionals And Control Flows

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From Bob Gailer <bgailer@gmail.com>
Newsgroups comp.lang.python
Subject Re: Conditionals And Control Flows
Date Wed, 4 May 2016 10:54:03 -0400
Lines 29
Message-ID <mailman.385.1462373653.32212.python-list@python.org> (permalink)
References <f12b6c42-8edb-4f91-8994-7c122e99461e@googlegroups.com> <CAP1rxO4y_vz6h+s3KKC5V8b3U8O_QnvDhAC6sxOuHi6QnWuWrg@mail.gmail.com> <CAP1rxO5rQEtNQksp25YkARo1pYBBiQjOTY5vVCjZ5Hg4-KAehg@mail.gmail.com>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
X-Trace news.uni-berlin.de ALz35/wcgzhAvORQ8ksk0QZb18vxrxKKsCRKxWft36Jg==
Return-Path <bgailer@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'operator': 0.03; 'true)': 0.07; 'cc:addr:python-list': 0.09; 'caveat': 0.09; 'false)': 0.09; 'statements': 0.09; 'python': 0.10; 'python.': 0.11; 'argument': 0.15; '"and"': 0.16; '10:45': 0.16; '2016': 0.16; 'boolean': 0.16; 'cc:name:python list': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; '&lt;': 0.18; 'instance,': 0.18; '&gt;': 0.18; 'email addr:gmail.com&gt;': 0.18; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'trying': 0.22; 'am,': 0.23; 'header:In-Reply-To:1': 0.24; 'example': 0.26; 'message-id:@mail.gmail.com': 0.27; 'correct': 0.28; '---': 0.28; 'operators': 0.29; 'supposed': 0.31; 'statement': 0.32; 'received:google.com': 0.35; 'false': 0.35; 'should': 0.36; 'received:209.85': 0.36; 'subject:: ': 0.37; 'skip:& 10': 0.37; 'received:209': 0.38; 'received:209.85.220': 0.38; 'determine': 0.61; 'results': 0.66; 'subject:Control': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=INwri2AqbOQ2jOGindj7cznzbBfQAZ71M/m7kml6ocY=; b=XrYEHFHQk+36Vh3AYVYo3x2E3WzIykjMqrhrL8KIyCjASw9Z2/Y1/LDnRPNtARgLIm vuXeYioGLCE+X30H0Ut+cB0yNGbbt6aTbE0zDEXCL/Sv5VfVC2yXWNqZbPhf8f7vZn/C CSa2lI7aF0zdIuh3/O+2HCRkQu6DE0KlJ+J5X1I1oObQmxm31DbQIMvjJfjAnuZI1S0I QvfQRiiVGuaTY1lh1Db0c3IMHCyz2caNRRUKoP5N/3HTiwwmFsGUQOR0rYC0/HvdggqV rhBPKd5St/4nmn6NkSY8N2rQmhNO4CLIDVUEnMqfBRWpxSNTfCYj/vDbqgmpssEfBdig Zg4Q==
X-Google-DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=INwri2AqbOQ2jOGindj7cznzbBfQAZ71M/m7kml6ocY=; b=knRYUeYoqQ/3zth6i2c7Xjba1Y28+0h8R38e6uCFkwcUrkxI0SSz6NbuQ8vdPfFrX8 ZbyNjuj3Nh0NrF3qOcEbgAqulsi7bSgTShFc8cdg5T2sMVfcon9xXe22qQ9ohLK8dKj/ vfugoNlh8r4c3zW1L3s6Ce8Zj46lnK3rRUyfHiHmPr7VcEu3Au8bZq+6PKRqjvq2BHzQ Oj45GA26vSHZjA/L0MrK3dGWHjSXtnu0cGZISYD0+fX37ir1TAEo5XzA3Go9Jeyz4+YT CuC/yE4vbss6q488uyTyCF4gpXkzUQK47kfTskBSYZAcfE6PX1aS9iUky9oAVrDQzBLK KQRQ==
X-Gm-Message-State AOPr4FVL1kYZ9nfcXWNujrJ8/NQfCLzyVdnw/eqjq52Ukza5+68FERM6OoHkAZFR3Dzz0ovJw2MXC4hp1knzZA==
X-Received by 10.55.178.198 with SMTP id b189mr8466096qkf.98.1462373643959; Wed, 04 May 2016 07:54:03 -0700 (PDT)
In-Reply-To <CAP1rxO4y_vz6h+s3KKC5V8b3U8O_QnvDhAC6sxOuHi6QnWuWrg@mail.gmail.com>
X-Content-Filtered-By Mailman/MimeDel 2.1.22
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.22
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID <CAP1rxO5rQEtNQksp25YkARo1pYBBiQjOTY5vVCjZ5Hg4-KAehg@mail.gmail.com>
X-Mailman-Original-References <f12b6c42-8edb-4f91-8994-7c122e99461e@googlegroups.com> <CAP1rxO4y_vz6h+s3KKC5V8b3U8O_QnvDhAC6sxOuHi6QnWuWrg@mail.gmail.com>
Xref csiph.com comp.lang.python:108135

Show key headers only | View raw


On May 4, 2016 10:45 AM, "Cai Gengyang" <gengyangcai@gmail.com> wrote:
>
> I am trying to understand the boolean operator "and" in Python. It is
supposed to return "True" when the expression on both sides of "and" are
true
>
> For instance,
>
> 1 < 3 and 10 < 20 is True --- (because both statements are true)
> 1 < 5 and 5 > 12 is False --- (because both statements are false)
>
> bool_one = False and False --- This should give False because none of the
statements are False
> bool_two = True and False --- This should give False because only 1
statement is True
> bool_three = False and True --- This should give False because only 1
statement is True
> bool_five = True and True --- This should give True because only 1
statement is True
>
> Am I correct ?
Yes. Caveat : python Boolean operators return the value of the last
argument necessary to determine the outcome.
Example :
2 or 3 results in 2
2 and 3 results in 3.
0 and 3 results in 0.

HTH.

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


Thread

Conditionals And Control Flows Cai Gengyang <gengyangcai@gmail.com> - 2016-05-04 07:41 -0700
  Re: Conditionals And Control Flows Bob Gailer <bgailer@gmail.com> - 2016-05-04 10:54 -0400
  Re: Conditionals And Control Flows Michael Selik <michael.selik@gmail.com> - 2016-05-04 14:56 +0000
  Re: Conditionals And Control Flows Chris Angelico <rosuav@gmail.com> - 2016-05-05 00:58 +1000
  Re: Conditionals And Control Flows Jussi Piitulainen <jussi.piitulainen@helsinki.fi> - 2016-05-04 18:10 +0300
    Re: Conditionals And Control Flows Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-05-04 16:21 +0100
    Re: Conditionals And Control Flows Cai Gengyang <gengyangcai@gmail.com> - 2016-05-04 08:23 -0700
      Re: Conditionals And Control Flows Jussi Piitulainen <jussi.piitulainen@helsinki.fi> - 2016-05-04 19:41 +0300
  Re: Conditionals And Control Flows Stephen Hansen <me+python@ixokai.io> - 2016-05-04 11:54 -0700

csiph-web