Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Jorge Gimeno Newsgroups: comp.lang.python Subject: Fwd: Operator Precedence/Boolean Logic Date: Tue, 21 Jun 2016 20:56:21 -0700 Lines: 30 Message-ID: References: <15997174-44d5-431c-8f90-a8d700921820@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de Q1fQhHtafDvqvD5U0UdEvQQLFYvlkpDpyGAAUWD3Z3ig== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'received:209.85.223': 0.03; 'true,': 0.04; '21,': 0.07; 'false.': 0.07; 'great.': 0.07; 'true)': 0.07; 'replied': 0.09; 'python': 0.10; '2016': 0.16; '8:40': 0.16; 'evaluates': 0.16; 'false:': 0.16; 'list)': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; 'email addr:gmail.com>': 0.18; 'header:In-Reply-To:1': 0.24; 'message-id:@mail.gmail.com': 0.27; 'directly,': 0.29; 'subject:/': 0.30; 'url:mailman': 0.30; 'help!': 0.30; 'url:python': 0.33; 'true.': 0.33; 'skip:- 10': 0.34; 'url:listinfo': 0.34; 'tue,': 0.34; 'received:google.com': 0.35; 'could': 0.35; 'false': 0.35; 'but': 0.36; 'instead': 0.36; 'url:org': 0.36; 'received:209.85': 0.36; 'to:addr:python-list': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'there,': 0.37; 'received:209': 0.38; 'someone': 0.38; 'thank': 0.38; 'does': 0.39; 'url:mail': 0.40; 'to:addr:python.org': 0.40; 'your': 0.60; 'here': 0.66; 'teaching': 0.69; 'elizabeth': 0.72; 'confusing': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=PDM1tfHZWTwcXuSLv2r79NMNbcX78Ytt8qY+ov9/lEM=; b=k35rVSgnvKdg89yZI+YVQ8fPAE9X6yKkhmua1SodMmRKB/NcfN76PDW8lMGeMrcgSf RBmJ+f/OKbfOR5y9kC3v/2IQMgt/+pQehdbSr2JFdaEehFK2uziZ3t/nMRk7BCU0gmF5 btC7Tza6wrc8dqGtYBb2hpk6Ixag2EfBoGzV1GWpuMCTayd8DxXukpOmKfv+iJbfz0ZV lTj/BwGzVWT0hicZJO6SHUat2lTQESK5/xd22dsvrevUZBhhq44g2wVtlXkw8+LSrq8V 18/nUw/71N+kpmm6WdZwoQoNsm+/9wBEwazlI8wluyeMr38js/o7K/bPZbN/lQwnb17o KQYw== 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:from:date :message-id:subject:to; bh=PDM1tfHZWTwcXuSLv2r79NMNbcX78Ytt8qY+ov9/lEM=; b=VIVuojdlATqSZYQ43TibUKSRBJOv2mRv1LaRHjjyr9H5Xceel0Wzbxb8SfcMyLTAv8 gGSadfNsGd3C31mOHY0vR7xRvWLDZudWEFFR7cFT03VbJkBKPCmQ8KIrFyjP3Z0A0tPF AEsaoB81NbtKUjFHFUZwZ8WvMIUK9bHb8CJkJeXcvpwDracNy3gb9pJZ87R75M7Fjbzr zelAb3eumvOMh90rI3tqIxHSAayFzBnVFC5YFW2gV9Xewr6wr6cOWseAI+G8sNB6yIWS FJUjshDEKNYknxdIrK0zPotaiPu5uDr4o4w+weojwUt3Ka7PcIdx/GSIHx1ebkxnkWQK juEQ== X-Gm-Message-State: ALyK8tKDEtKIATGZXSYrcstOuFrhvr8QkzNxMMlSgPZ78qhtGMgSdpfQ8QyEksQxkupM8KFUJ6bhSwKivZnmBg== X-Received: by 10.107.18.35 with SMTP id a35mr40653192ioj.116.1466567781611; Tue, 21 Jun 2016 20:56:21 -0700 (PDT) In-Reply-To: X-Mailman-Approved-At: Wed, 22 Jun 2016 06:48:38 -0400 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: X-Mailman-Original-References: <15997174-44d5-431c-8f90-a8d700921820@googlegroups.com> Xref: csiph.com comp.lang.python:110310 On Tue, Jun 21, 2016 at 8:40 PM, Elizabeth Weiss wrote: > Hi There, > > I am a little confused as to how this is False: > > False==(False or True) > > I would think it is True because False==False is true. > > I think the parenthesis are confusing me. > > (False==False) or True > > This is True. Is it because False==False? And True==False is not True but > that does not change that this is True. > > If someone could please explain as I am teaching Python to myself and am > stuck on this that would be great. > Thank you for your help! > -- > https://mail.python.org/mailman/listinfo/python-list > You have 2 comparisons here . The first is inside the parenthesis, (False or True) evaluates to True. What remains of the expression is False == True, which is False. -Jorge (Reposted because I replied to the OP directly, instead of to the list)