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


Groups > comp.lang.python > #52087

Re: Beginner question

Path csiph.com!usenet.pasdenom.info!gegeweb.org!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <chris@chrisdown.name>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.017
X-Spam-Evidence '*H*': 0.97; '*S*': 0.00; '"if': 0.09; 'statements': 0.09; 'subject:question': 0.10; 'cc:addr:python-list': 0.11; '"elif"': 0.16; '"if"': 0.16; 'email addr:comcast.net': 0.16; 'through,': 0.16; 'wrote:': 0.18; 'thanks.': 0.20; 'cc:addr:python.org': 0.22; 'header:User-Agent:1': 0.23; 'from:addr:chris': 0.24; 'received:213.165': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'statement': 0.30; 'code': 0.31; 'prints': 0.31; 'received:google.com': 0.35; 'right?': 0.36; 'charset:us-ascii': 0.36; 'previous': 0.38; 'received:74.125': 0.39; 'chain': 0.60; 'matter': 0.61; 'first': 0.61; 'content-disposition:inline': 0.62; 'to:addr:comcast.net': 0.91
X-Google-DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to:pgp-key :user-agent; bh=zXNeimx+OdbX0ZhZT46ENKN67uYw1OmdumU06jmkDIQ=; b=RUyubxkn0DEDoPmYuBvy0N08DlE02uPGwq3sX18D4hXve/MUbFCX1TfzfKTMXuDXXL PBPalH5riUQEXJYEYuPZDHfOUZxgDklTInYe5OdWpp8xakgUZ/IYAg5xg0BU+m/ZLdgc eAoClAZBEcVY1JSG4hewa74I0ggAMr0lPRuYjfRmobqXlxiokLEBweVUgInmXptJGQm8 +yFFyVr2+v7sSQtWf5JIiU/YndsCcq5u7uuZDWwMUqJzdjoWEGeZ59N96VQqO7YEu2a3 7goVTXt3eSGAeKy4J68GKpVGfk5WKUrgHJb1sdWsvwrvnbhDuGcrQdAxxu4VRRP4FZ/6 4qQQ==
X-Gm-Message-State ALoCoQmQ6obgdWB517MhZbjoucIgM5EdP6eqovjoL0djot7K5/cszt7TXQx2DJtpkYcbdZmrNfmc
X-Received by 10.14.211.134 with SMTP id w6mr213967eeo.26.1375825614183; Tue, 06 Aug 2013 14:46:54 -0700 (PDT)
Date Tue, 6 Aug 2013 23:46:51 +0200
From Chris Down <chris@chrisdown.name>
To eschneider92@comcast.net
Subject Re: Beginner question
References <6e80b2f8-0b14-43cd-b8af-211ef65d73ba@googlegroups.com>
MIME-Version 1.0
Content-Type multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="+B+y8wtTXqdUj1xM"
Content-Disposition inline
In-Reply-To <6e80b2f8-0b14-43cd-b8af-211ef65d73ba@googlegroups.com>
PGP-Key http://chrisdown.name/pgp
User-Agent Mutt/1.5.21 (2010-09-15)
X-Mailman-Approved-At Wed, 07 Aug 2013 01:43:20 +0200
Cc python-list@python.org
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://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 <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.284.1375832602.1251.python-list@python.org> (permalink)
Lines 30
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1375832602 news.xs4all.nl 15948 [2001:888:2000:d::a6]:36946
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:52087

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

On 2013-08-06 14:35, eschneider92@comcast.net wrote:
> Why won't the 'goodbye' part of this code work right? it prints 'ok' no
> matter what is typed. Much thanks.

"if" statements do not fall through, because the first statement was matched,
no other ones in the same chain will be evaluted.

"elif" means "else if", where "else" means "if nothing previous matched".

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


Thread

Beginner question eschneider92@comcast.net - 2013-08-06 14:35 -0700
  Re: Beginner question Dave Angel <davea@davea.name> - 2013-08-06 22:03 +0000
  Re: Beginner question Chris Angelico <rosuav@gmail.com> - 2013-08-06 23:10 +0100
  Re: Beginner question "Rhodri James" <rhodri@wildebst.demon.co.uk> - 2013-08-06 23:14 +0100
  Re: Beginner question Chris Down <chris@chrisdown.name> - 2013-08-06 23:46 +0200
  Re: Beginner question eschneider92@comcast.net - 2013-08-06 20:06 -0700

csiph-web