Re: [Tutor] Unknown Cause of Error

2013-05-11 Thread Steven D'Aprano
On 11/05/13 12:13, Jack Little wrote: I have a slight problem. My program will not open. What do you mean open? How are you trying to open it? What editor are you opening it in? Or do you mean your program will not *run*? How are you trying to run it? On top of that, I have written

Re: [Tutor] range efficiency

2013-05-11 Thread Steven D'Aprano
On 11/05/13 07:19, Jim Mooney wrote: If I'm using a variable-dependent range in a for loop, is Python smart enough to figure the variable once so I don't have to hoist it up? That is for c in range(0,x+2), is x+2 figured once or every time through the loop? I'm assuming it's once but I like to

Re: [Tutor] Tutor Digest, Vol 111, Issue 24

2013-05-11 Thread Steven D'Aprano
On 11/05/13 06:17, Alan Gauld wrote: Pascal is still case agnostic and in that community its often seen as a benefit since it avoids a whole class of error - when you type the case of a word wrongly... Interesting that you say that. Just the other week I was reading a page somewhere talking

Re: [Tutor] Unknown Cause of Error

2013-05-11 Thread Alan Gauld
On 11/05/13 07:12, Steven D'Aprano wrote: def menu(): print Welcome to Tomb Explorer! print A game of Exploration from Bulldog Development print Press [1] to Play or [2] to Exit menu1=raw_input( ) if menu1== 2: quit() if menu1== 1: room1()

Re: [Tutor] range efficiency

2013-05-11 Thread eryksun
On Fri, May 10, 2013 at 5:19 PM, Jim Mooney cybervigila...@gmail.com wrote: If I'm using a variable-dependent range in a for loop, is Python smart enough to figure the variable once so I don't have to hoist it up? At the start of a for loop, the interpreter gets an iterator for the iterable.

Re: [Tutor] Tutor Digest, Vol 111, Issue 24

2013-05-11 Thread Alan Gauld
On 11/05/13 07:51, Steven D'Aprano wrote: Pascal is still case agnostic and in that community its often seen as a benefit... Interesting that you say that. Just the other week I was reading a page somewhere talking about some Pascal compiler, and it made a comment that by popular request the

[Tutor] Making a Primary Number List generator

2013-05-11 Thread Daniel Magruder
Dear Tutor at Python.org, I am new to the python language and have been teaching myself through various online resources. I found an exercise where I am to create a program that prints a list of the first 1000 prime numbers. After many attempts and looking at other answers for other ways around

Re: [Tutor] Making a Primary Number List generator

2013-05-11 Thread Dave Angel
On 05/11/2013 04:44 PM, Daniel Magruder wrote: Dear Tutor at Python.org, I am new to the python language and have been teaching myself through various online resources. I found an exercise where I am to create a program that prints a list of the first 1000 prime numbers. After many attempts

Re: [Tutor] range efficiency

2013-05-11 Thread Danny Yoo
On Fri, May 10, 2013 at 3:19 PM, Jim Mooney cybervigila...@gmail.com wrote: If I'm using a variable-dependent range in a for loop, is Python smart enough to figure the variable once so I don't have to hoist it up? Hi Jim, The gritty details say yes: