Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.015 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'mrab': 0.05; 'see:': 0.07; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'sentence': 0.09; 'evaluates': 0.16; 'parentheses': 0.16; 'received:80.91.229.3': 0.16; 'received:mnet-online.de': 0.16; 'received:plane.gmane.org': 0.16; 'result.': 0.19; 'header:User- Agent:1': 0.23; 'looks': 0.24; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; "doesn't": 0.30; '???': 0.30; 'you?': 0.31; "can't": 0.35; 'something': 0.35; 'no,': 0.35; 'but': 0.35; 'leads': 0.36; "didn't": 0.36; 'wrong': 0.37; 'to:addr:python-list': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'how': 0.40; 'read': 0.60; 'expression': 0.60; 'first': 0.61; 'name': 0.63; '8bit%:92': 0.71; '8bit%:100': 0.72; 'received:93': 0.72; 'subject:gets': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Sibylle Koczian Subject: Re: A certainl part of an if() structure never gets executed. Date: Wed, 12 Jun 2013 21:48:19 +0200 References: <2bc90d3b-09c2-4315-9357-ff7f039465e0@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Gmane-NNTP-Posting-Host: ppp-93-104-177-249.dynamic.mnet-online.de User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 40 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1371066517 news.xs4all.nl 15985 [2001:888:2000:d::a6]:49414 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:47835 Am 12.06.2013 20:06, schrieb Νικόλαος Κούρας: > Whn i see: > > if( x and y ): > i understand: if x expression = True AND ALSO y expression = True then > execute > > > if( x or y ): > i understand: if x expression = True OR y expression = True then execute > You didn't read MRABs explanation, did you? > if '=' not in ( name and month and year ): > i understand: if '=' not in name AND '=' not in month AND '=' not in year > Wrong. The "'=' not in (...)" first evaluates the expression in parentheses, that's what parentheses are for. And then it looks for '=' in the result. And that result is just one of the three values, MRAB told you which one. > > if '=' not in ( name or month or year ): > i understand: if '=' not in name OR '=' not in month OR '=' not in year > Same here. You can't take the "'=' in" out of the parentheses, that leads to a wrong result. > > but i know it does not work like this, but tis is how i understand it. ??? If you know it doesn't work like this, then it won't help you to wilfully understand something you'd like to be true. > its like reading an English sentence > No, this time it isn't. HTH Sibylle