On 24 Feb 2006 14:08:22 -0800
[EMAIL PROTECTED] wrote:
> Reply to all: I realize that naming a variable "spam" is
> not entirely kosherized.
In fact this is untrue: It is an official rule straight
from the BDFL himself that example programs should contain
words like "spam", "ham", "eggs" from the
On Fri, 24 Feb 2006 14:08:22 -0800, darthbob88 wrote:
> Reply to all: I realize that naming a variable "spam" is not entirely
> kosherized. It was originally named secret, but I renamed it in a fit
> of whimsy. The language is named after Monty Python's Flying Circus, is
> it not? Remember the Spa
Reply to all: I realize that naming a variable "spam" is not entirely
kosherized. It was originally named secret, but I renamed it in a fit
of whimsy. The language is named after Monty Python's Flying Circus, is
it not? Remember the Spam Sketch.
http://en.wikipedia.org/wiki/Spam_sketch
I thank you
Steven D'Aprano wrote:
> On Fri, 24 Feb 2006 00:24:25 +, Jeffrey Schwab wrote:
>
>
>>Steven D'Aprano wrote:
>>
>>>On Thu, 23 Feb 2006 12:05:59 -0800, darthbob88 wrote:
>>>
>>>My comments inserted inline.
>>>
>>>
>>>
>>>
#!/usr/bin/python
#simple guessing game, with numbers
import
On Fri, 24 Feb 2006 01:50:40 -0800, bonono wrote:
> Steven D'Aprano wrote:
>> Just out of curiosity, when do you think is the right time to begin
>> teaching programmers good practice from bad? Before or after they've
>> learnt bad habits?
>
> When you have authority over the coding guideline.
Steven D'Aprano wrote:
> Just out of curiosity, when do you think is the right time to begin
> teaching programmers good practice from bad? Before or after they've
> learnt bad habits?
When you have authority over the coding guideline. Naming things is not
something limited to programming and most
On Fri, 24 Feb 2006 00:24:25 +, Jeffrey Schwab wrote:
> Steven D'Aprano wrote:
>> On Thu, 23 Feb 2006 12:05:59 -0800, darthbob88 wrote:
>>
>> My comments inserted inline.
>>
>>
>>
>>>#!/usr/bin/python
>>>#simple guessing game, with numbers
>>>import random
>>>spam = random.randint(1, 100)
Steven D'Aprano wrote:
> On Thu, 23 Feb 2006 12:05:59 -0800, darthbob88 wrote:
>
> My comments inserted inline.
>
>
>
>>#!/usr/bin/python
>>#simple guessing game, with numbers
>>import random
>>spam = random.randint(1, 100)
>
>
> It is bad programming practice to give variables uninformative
On Thu, 23 Feb 2006 12:05:59 -0800, darthbob88 wrote:
My comments inserted inline.
> #!/usr/bin/python
> #simple guessing game, with numbers
> import random
> spam = random.randint(1, 100)
It is bad programming practice to give variables uninformative joke names.
How about target instead?
> p
[EMAIL PROTECTED] wrote in news:1140725159.143882.202630
@j33g2000cwa.googlegroups.com:
>
> Steven D'Aprano wrote:
>> You could try this:
>>
>> while 1:
>> var = raw_input("Give me some data! ")
>> if var == "some data":
>> print "Success!"
>> break
>> else:
>>
Steven D'Aprano wrote:
> [EMAIL PROTECTED] wrote:
>
> > Problem: I wish to run an infinite loop and initialize a variable on
> > each iteration. Sort of like, "Enter Data", test it, "No good!", "Next
> > Try?", test it, etc. What I've tried is simply while 1: var1 =
> > raw_input, test var1, then
[EMAIL PROTECTED] wrote:
> Problem: I wish to run an infinite loop and initialize a variable on
> each iteration. Sort of like, "Enter Data", test it, "No good!", "Next
> Try?", test it, etc. What I've tried is simply while 1: var1 =
> raw_input, test var1, then run through the loop again. What re
I tried this code and it worked fine:
while 1:
var1 = raw_input("Enter a number: ")
print "You entered:",var1
var1 = int(var1) + 1
print var1
--
http://mail.python.org/mailman/listinfo/python-list
Problem: I wish to run an infinite loop and initialize a variable on
each iteration. Sort of like, "Enter Data", test it, "No good!", "Next
Try?", test it, etc. What I've tried is simply while 1: var1 =
raw_input, test var1, then run through the loop again. What results is
var1 gets and keeps the f
14 matches
Mail list logo