Re: [Tutor] syntax error that i cant spot!

2011-01-05 Thread Noah Hall
> > "Please" and "Thank you" are rude? Oh my, have you lived a sheltered life > :) > Nej, it was your condescension that I found rude. Also, you did it again, perhaps on purpose though.. ;) ___ Tutor maillist - Tutor@python.org To unsubscribe or change

Re: [Tutor] syntax error that i cant spot!

2011-01-05 Thread Steven D'Aprano
Noah Hall wrote: Please quote enough of the previous message to establish context -- when you are replying to the message, it is fresh in your mind. When others read your reply (possibly days later like I'm doing now), the context is anything but clear and your message comes across as merely mys

Re: [Tutor] syntax error that i cant spot!

2011-01-05 Thread Noah Hall
> > Please quote enough of the previous message to establish context -- when > you are replying to the message, it is fresh in your mind. When others read > your reply (possibly days later like I'm doing now), the context is anything > but clear and your message comes across as merely mysterious a

Re: [Tutor] syntax error that i cant spot!

2011-01-05 Thread Steven D'Aprano
Noah Hall wrote: He has no classes in there. Therefore, there is no place it should be in this code. Please remember this is Python, and not Java nor anything else. [...] It just makes life easier. Oh the irony... talking about making life easier, who are you talking to? What about? Please

Re: [Tutor] syntax error that i cant spot!

2011-01-02 Thread Wayne Werner
On Sun, Jan 2, 2011 at 9:52 AM, Alan Gauld wrote: > "Corey Richardson" wrote > > On Sat, Jan 1, 2011 at 9:10 PM, Alan Gauld >>> wrote: >>> Why avoidCamelCase? I actually prefer it to using_non_camel_case >>> >>> Python appears to use camelCase more than not. >>> >>> >> I tend to disag

Re: [Tutor] syntax error that i cant spot!

2011-01-02 Thread Ken Green
I generally prefer Camel Case as easily to use as it would be more difficult for me as a touch typist to hunt and peck for the underscore. Ken On 01/02/2011 09:40 AM, Brett Ritter wrote: On Sat, Jan 1, 2011 at 9:10 PM, Alan Gauld wrote: Why avoidCamelCase? I actually prefer it to using_non_c

Re: [Tutor] syntax error that i cant spot!

2011-01-02 Thread Alan Gauld
"Corey Richardson" wrote On Sat, Jan 1, 2011 at 9:10 PM, Alan Gauld wrote: Why avoidCamelCase? I actually prefer it to using_non_camel_case Python appears to use camelCase more than not. I tend to disagree with that. In the stdlib, as well as the builtins, many, many methods are alllow

Re: [Tutor] syntax error that i cant spot!

2011-01-02 Thread Corey Richardson
On 01/02/2011 09:40 AM, Brett Ritter wrote: > On Sat, Jan 1, 2011 at 9:10 PM, Alan Gauld wrote: >> Why avoidCamelCase? I actually prefer it to using_non_camel_case > > The readability is an often argued topic - I myself find the space of > names_in_underscores to be more readable (words are disti

Re: [Tutor] syntax error that i cant spot!

2011-01-02 Thread Hugo Arts
On Sun, Jan 2, 2011 at 3:40 PM, Brett Ritter wrote: > On Sat, Jan 1, 2011 at 9:10 PM, Alan Gauld wrote: >> Why avoidCamelCase? I actually prefer it to using_non_camel_case > > The readability is an often argued topic - I myself find the space of > names_in_underscores to be more readable (words a

Re: [Tutor] syntax error that i cant spot!

2011-01-02 Thread Brett Ritter
On Sat, Jan 1, 2011 at 9:10 PM, Alan Gauld wrote: > Why avoidCamelCase? I actually prefer it to using_non_camel_case The readability is an often argued topic - I myself find the space of names_in_underscores to be more readable (words are distinct), but I try to follow the common conventions of t

Re: [Tutor] syntax error that i cant spot!

2011-01-02 Thread Noah Hall
He has no classes in there. Therefore, there is no place it should be in this code. Please remember this is Python, and not Java nor anything else. To quote directly from PEP 8, in regards to functions and variables, "should be lowercase, with words separated by underscoresas necessary to improve

Re: [Tutor] syntax error that i cant spot!

2011-01-02 Thread Alan Gauld
"Noah Hall" wrote It's part of the Python naming conventions laid out by PEP 8. Have a read here - http://www.python.org/dev/peps/pep-0008/. I'm quite familiar with PEP8 - although I disagree with quite a lot of it too! But PEP 8 is about consistency of style not "readability" which was w

Re: [Tutor] syntax error that i cant spot!

2011-01-01 Thread Noah Hall
It's part of the Python naming conventions laid out by PEP 8. Have a read here - http://www.python.org/dev/peps/pep-0008/. Hope this helps. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mail

Re: [Tutor] syntax error that i cant spot!

2011-01-01 Thread Alan Gauld
"Noah Hall" wrote By the way, for readability, tryToavoidCamelCase. Why avoidCamelCase? I actually prefer it to using_non_camel_case But it's been the standard in OOP languages since at least Smalltalk 80 (ie 1980) so I guess I'm just used to it... Alan G.

Re: [Tutor] syntax error that i cant spot!

2011-01-01 Thread Ken Green
He had no space between the plus sign and the name value and that threw me. I am so used to using a space before or after the plus sign. Ken On 01/01/2011 02:46 PM, bob gailer wrote: On 1/1/2011 2:28 PM, Ken Green wrote: I am caught off guard but what is the purpose of the plus sign? I don'

Re: [Tutor] syntax error that i cant spot!

2011-01-01 Thread Noah Hall
> > > I am caught off guard but what is the purpose of the plus sign? I don't > recall seeing it used like that. > The + sign there is used for concating two strings together, for example - output = 'foo' + 'bar' Will give the variable output the value of the characters 'foobar'. This also work

Re: [Tutor] syntax error that i cant spot!

2011-01-01 Thread bob gailer
On 1/1/2011 2:28 PM, Ken Green wrote: I am caught off guard but what is the purpose of the plus sign? I don't recall seeing it used like that. I just tried to look that up in the Python Manuals. No success! Where is it hiding? *** OOPS just found it in section 6.6 Sequence Types s + t the c

Re: [Tutor] syntax error that i cant spot!

2011-01-01 Thread bob gailer
On 1/1/2011 2:28 PM, Ken Green wrote: I am caught off guard but what is the purpose of the plus sign? I don't recall seeing it used like that. I just tried to look that up in the Python Manuals. No success! Where is it hiding? >>> a = 'a' >>> b = 'b' >>> c = a + b >>> print c ab Now you ca

Re: [Tutor] syntax error that i cant spot!

2011-01-01 Thread Corey Richardson
On 01/01/2011 02:28 PM, Ken Green wrote: I am caught off guard but what is the purpose of the plus sign? I don't recall seeing it used like that. Ken On 01/01/2011 12:11 PM, Abhijeet Rastogi wrote: You missed a "+" after myName on line 30. On Sat, Jan 1, 2011 at 10:32 PM, pete mailto:psmo...@

Re: [Tutor] syntax error that i cant spot!

2011-01-01 Thread Ken Green
I am caught off guard but what is the purpose of the plus sign? I don't recall seeing it used like that. Ken On 01/01/2011 12:11 PM, Abhijeet Rastogi wrote: You missed a "+" after myName on line 30. On Sat, Jan 1, 2011 at 10:32 PM, pete > wrote: Hi, Please

Re: [Tutor] syntax error that i cant spot!

2011-01-01 Thread David Hutto
You also can place: else: print " this is not a number" And: if guess == number: break if guess == number: guessesTaken = str(guessesTaken) print 'Good job, ' + myName + "! You guessed the number in " + guessesTaken + ' guesses!' which could be combined. if guess =

Re: [Tutor] syntax error that i cant spot!

2011-01-01 Thread Knacktus
Am 01.01.2011 18:02, schrieb pete: Hi, Please help just starting out and have come up with the following code to create a simple guessing game. on line 30 print good job etc i get a syntax error! sure it's simple but i've looked for ages and cant spot it! There's a + missing after myName Also,

Re: [Tutor] syntax error that i cant spot!

2011-01-01 Thread David Hutto
On Sat, Jan 1, 2011 at 12:02 PM, pete wrote: > Hi, > Please help just starting out and have come up with the following code to > create a simple guessing game. > > on line 30 print good job etc i get a syntax error! sure it's simple but > i've looked for ages and cant spot it! > > Regards > Pete

Re: [Tutor] syntax error that i cant spot!

2011-01-01 Thread Abhijeet Rastogi
You missed a "+" after myName on line 30. On Sat, Jan 1, 2011 at 10:32 PM, pete wrote: > Hi, > Please help just starting out and have come up with the following code to > create a simple guessing game. > > on line 30 print good job etc i get a syntax error! sure it's simple but > i've looked for

[Tutor] syntax error that i cant spot!

2011-01-01 Thread pete
Hi, Please help just starting out and have come up with the following code to create a simple guessing game. on line 30 print good job etc i get a syntax error! sure it's simple but i've looked for ages and cant spot it! Regards Pete # guess the number game import random guessesTaken = 0 p