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