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


Groups > comp.lang.python > #43820

Re: Novice Issue

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder3.xlned.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <davea@davea.name>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.138
X-Spam-Level *
X-Spam-Evidence '*H*': 0.73; '*S*': 0.00; 'string': 0.09; '#empty': 0.16; 'received:74.208.4.195': 0.16; 'wrote:': 0.18; 'subject:Issue': 0.19; 'header:User-Agent:1': 0.23; 'header:In- Reply-To:1': 0.27; 'point': 0.28; 'am,': 0.29; 'wright': 0.31; 'another': 0.32; 'call.': 0.33; "i'd": 0.34; 'but': 0.35; 'add': 0.35; 'thanks': 0.36; 'list': 0.37; 'list.': 0.37; 'whatever': 0.38; 'to:addr:python-list': 0.38; 'list,': 0.38; 'to:addr:python.org': 0.39; "you've": 0.63; 'finish': 0.65; 'prompt': 0.68; 'received:74.208': 0.68; 'examine': 0.93
Date Thu, 18 Apr 2013 08:29:37 -0400
From Dave Angel <davea@davea.name>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130308 Thunderbird/17.0.4
MIME-Version 1.0
To python-list@python.org
Subject Re: Novice Issue
References <0fa050c1-3a00-4c17-9fa6-b79a22485c7a@googlegroups.com> <36c94c5e-6ad1-4aba-b18c-61cf14cf102c@googlegroups.com>
In-Reply-To <36c94c5e-6ad1-4aba-b18c-61cf14cf102c@googlegroups.com>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Provags-ID V02:K0:FEW3rmQvENUUcj04l4fSZLPEEdfKl5xG70Arwq5w4OU ch6Q6ZHpieW+X7P4z+/lBvDPISSle4FwmBiljCEYVChODP0DSB g/gtGBy+Bwp17plH5mGm+5sWtu/rWUfKHKSUiph9H0G6GM14L1 K6M0q3UJNLryVcllibbT6Tb37TMIrEZ9i4RS0b2qaKOOOoZppn rIVU9uFFclOwObxltOzHJlgpAgBhK8ut+D+NsDL4XRTasBVDJ8 3J738E5hf+P2JfiJ8jHboDkApO8BGtfh6vamnHAPxQJJVc1y0i 6j+yuBZ8/4uCNRK/z8ktkqanHCWEAlEsaAByeTsQ1nsPdnjSA= =
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.764.1366288199.3114.python-list@python.org> (permalink)
Lines 28
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1366288199 news.xs4all.nl 2242 [2001:888:2000:d::a6]:38525
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:43820

Show key headers only | View raw


On 04/18/2013 08:18 AM, Bradley Wright wrote:
>
>    <SNIP>
>>

> Secondly, thanks Wolfgang
> while raw_input not in ("quit", "q") - genius, i get your point clearly

But you have to combine his point with Chris's, don't forget the parens 
on the call to raw_input.  And if it were I, I'd also put a prompt 
string in the call.

    while raw_input("q to quit") not in ("quit", "q"):

>

If you've got a list, and each time through you want to add some item(s) 
to a list, you can use the following idiom:

result = []     #empty list
for   whatever in something:
     value = another
     result.append(value)

Then when you finish the list, you can examine the whole list.

-- 
DaveA

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


Thread

Novice Issue Bradley Wright <bradley.wright.biz@gmail.com> - 2013-04-17 21:06 -0700
  Re: Novice Issue Chris Angelico <rosuav@gmail.com> - 2013-04-18 14:14 +1000
  Re: Novice Issue Wolfgang Maier <wolfgang.maier@biologie.uni-freiburg.de> - 2013-04-18 08:58 +0000
  Re: Novice Issue Chris Angelico <rosuav@gmail.com> - 2013-04-18 19:06 +1000
  Re: Novice Issue Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-04-18 11:10 +0100
  Re: Novice Issue Bradley Wright <bradley.wright.biz@gmail.com> - 2013-04-18 05:18 -0700
    Re: Novice Issue Dave Angel <davea@davea.name> - 2013-04-18 08:29 -0400
  Re: Novice Issue Bradley Wright <bradley.wright.biz@gmail.com> - 2013-04-18 05:34 -0700
  Re: Novice Issue John Gordon <gordon@panix.com> - 2013-04-18 14:21 +0000

csiph-web