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


Groups > comp.lang.python > #29549

Re: Programming Issues

Path csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <d@davea.name>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.009
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; '"__main__":': 0.07; '__name__': 0.07; 'calls.': 0.07; 'works.': 0.07; 'python': 0.09; 'does,': 0.09; 'logic': 0.09; 'def': 0.10; '3.2,': 0.16; '3.2.': 0.16; 'program"': 0.16; 'renamed': 0.16; 'sequence.': 0.16; 'statement.': 0.16; 'subject:Programming': 0.16; 'top-level': 0.16; 'write.': 0.16; 'wrote:': 0.17; 'thanks,': 0.18; 'examples': 0.18; 'saying': 0.18; 'code,': 0.18; 'input': 0.18; 'putting': 0.20; '2.x': 0.22; 'statement': 0.23; 'to:2**1': 0.23; 'header:In- Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'possibly': 0.27; 'raw': 0.27; 'in.': 0.27; 'loop,': 0.29; 'this.': 0.29; "i'm": 0.29; 'normally': 0.30; 'sense': 0.31; 'code': 0.31; 'running': 0.32; 'could': 0.32; 'print': 0.32; 'like:': 0.33; 'problem': 0.33; 'to:addr:python-list': 0.33; 'everyone': 0.33; 'progress': 0.33; 'skip:d 20': 0.34; 'version': 0.34; 'done': 0.34; 'list': 0.35; 'ahead': 0.35; 'problem,': 0.35; 'doing': 0.35; 'pm,': 0.35; 'similar': 0.35; 'something': 0.35; 'there': 0.35; 'but': 0.36; 'depends': 0.36; 'others.': 0.36; "i'll": 0.36; 'itself': 0.37; 'does': 0.37; 'being': 0.37; 'quite': 0.37; 'rather': 0.37; 'far': 0.37; 'data': 0.37; 'subject:: ': 0.38; 'mean': 0.38; 'sure': 0.38; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'list,': 0.39; 'where': 0.40; 'received:192.168': 0.40; 'think': 0.40; 'your': 0.60; 'interest': 0.62; 'personal': 0.62; 'helping': 0.63; 'times': 0.63; 'forward': 0.66; 'header:Reply-To:1': 0.68; 'received:74.208': 0.71; 'reply-to:no real name:2**0': 0.72; 'fortunately': 0.84; 'nathan': 0.84; 'remarks': 0.84; 'to:name:python': 0.84; 'responses': 0.93
Date Thu, 20 Sep 2012 07:34:34 -0400
From Dave Angel <d@davea.name>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120714 Thunderbird/14.0
MIME-Version 1.0
To Nathan Spicer <njspicy@gmail.com>, PYTHON <python-list@python.org>
Subject Re: Programming Issues
References <CAO1VxVw0xg9Y=5LV4_unpgFzPoSnmVy7-abi4e1-cUxrtvx0Mw@mail.gmail.com> <CAO1VxVx-GWFBL35T5LsnxYxhc0UeOKzndMZN3gsLzusanDsuFQ@mail.gmail.com> <50591DEC.6040904@davea.name> <CAO1VxVxFUBLMybxLMakF1=VGCC4wOFWwbnfQPWGCiDCrTMM96A@mail.gmail.com>
In-Reply-To <CAO1VxVxFUBLMybxLMakF1=VGCC4wOFWwbnfQPWGCiDCrTMM96A@mail.gmail.com>
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding 7bit
X-Provags-ID V02:K0:G1TonbXag3r7BOCuff7VmoH/5eY8HtF5nSSwTqhKyVl TF9jPGSxnkagmMOPTjWP37IaUuRE6DvprVOFivmE++0qeu+B4n 4tA1IEXv8H+cUVX4L3BOxkuf/kzJ1lwdk8JFm3Z4zDzw7gQQFQ VzvL8F4xGFY6vJnDON5PGisJzjdtNL2vcDcCjQWNFh7TxaOYp3 c/QouRLX//gn5MI5MaD7gqwX3zdTPlmOKUEu/vhag0Bq34r7ed g/OaTC1WcXDkzHmq250gIuCMKJjxPoOUkJ2GE1dNPtY/Ox5ibf YbtIsyba5vKUzwoaigbuFIqDH2oVMieDCeNM8VQLzX5tZU26Q= =
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
Reply-To d@davea.name
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.956.1348140904.27098.python-list@python.org> (permalink)
Lines 61
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1348140904 news.xs4all.nl 6983 [2001:888:2000:d::a6]:42527
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:29549

Show key headers only | View raw


On 09/19/2012 07:01 PM, Nathan Spicer wrote:
> Dave,
> 

You sent this response privately, which isn't the way the mailing list
works.  Private responses are good for thank-yous and for personal
remarks of no interest to others.  But you're short-circuiting the
helping process if you don't let everyone else see what you're saying
here.  I'll forward my response to the list, so others can jump in.

You also top-posted, rather than putting your remarks after what you're
quoting.

> I'm running Python 3.2. I think doing raw input is what the instructor is
> looking for.

What version of Python does the instructor think you're using?
raw_input is not in Python 3.2, being renamed to input().  The 2.x logic
of input() is fortunately gone, as it was quite unsafe.

> I know a need to do a loop, but the problem is i don't know ho
> to do this. 

An open-ended loop can be done with the while statement.  What I mean by
open-ended is that you have no way of predicting how many times it will
loop, because it depends on data you don't have ahead of time.  The
other type of loop is the for loop, where the loop will normally
progress till it processes all items in a sequence.

A while loop might look something like:

def ask_user():
    amount = get_amount()
    while amount != 0:
         do_some_stuff(amount)
         amount =  get_amount()
    print "done with program"  #

And your top-level code might look something like:

if __name__ == "__main__":
    ask_user()

If that makes sense to you, then write the functions that this one
calls.  If you don't understand this loop, then ask us to elaborate.
And if you don't understand what this while statement itself does, ask
your professor.


> There is no code, because i'm not sure how or what to write. So
> far we've done simple inputs. Are you aware of any examples similar to my
> problem, that i could look at and possibly base my program accordingly?
> 
> Thanks,
> Nathan
> 


-- 

DaveA

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


Thread

Re: Programming Issues Dave Angel <d@davea.name> - 2012-09-20 07:34 -0400

csiph-web