On 12 Feb 2012 05:23, "Tonu Mikk" wrote:
>
> I am learning Python using the "Learn Python the Hard Way" book by Zed
Shaw. I reached exercise 42 where we learn about Python classes. The
exercise shows a game with one class that includes all the definitions for
playing the game. For extra credit
On Thu, Feb 9, 2012 at 2:23 PM, Tonu Mikk wrote:
>
>
> On Mon, Feb 6, 2012 at 12:58 PM, Dave Angel wrote:
>>
>> On 02/06/2012 01:24 PM, Tonu Mikk wrote:
>>>
>>> Now I get an error: NameError: global name 'self' is not define.
>>>
>>> Tonu
>>>
>>>
>> Put your remarks after the stuff you quote. Y
On 02/09/2012 02:23 PM, Tonu Mikk wrote:
On Mon, Feb 6, 2012 at 12:58 PM, Dave Angel wrote:
On 02/06/2012 01:24 PM, Tonu Mikk wrote:
Now I get an error: NameError: global name 'self' is not define.
Tonu
Put your remarks after the stuff you quote. You're top-posting, which
makes the r
On Mon, Feb 6, 2012 at 12:58 PM, Dave Angel wrote:
> On 02/06/2012 01:24 PM, Tonu Mikk wrote:
>
>> Now I get an error: NameError: global name 'self' is not define.
>>
>> Tonu
>>
>>
>> Put your remarks after the stuff you quote. You're top-posting, which
> makes the reply difficult to follow.
>
On 02/06/2012 01:24 PM, Tonu Mikk wrote:
Now I get an error: NameError: global name 'self' is not define.
Tonu
Put your remarks after the stuff you quote. You're top-posting, which
makes the reply difficult to follow.
Use copy/paste to describe an error message. You retyped the one above
Now I get an error: NameError: global name 'self' is not define.
Tonu
On Mon, Feb 6, 2012 at 10:19 AM, Nate Lastname wrote:
> Hey Tonu,
>
> The problem is that in your statement definition, you are not
> including the self argument. Your definition needs to be something
> like:
> def dolt(sel
On 06/02/12 16:12, Tonu Mikk wrote:
Alan, thanks for explaining about passing objects to classes. This is
an important concept for me to understand.
I tried running the code, but run into an error that I could not resolve:
TypeError: doIt() takes no arguments (1 given).
Sorry the code was on
Hey Tonu,
The problem is that in your statement definition, you are not
including the self argument. Your definition needs to be something
like:
def dolt(self):
# Do stuff.
For more info on the self keyword, see
http://docs.python.org/tutorial/classes.html, section 9.3.2.
On 2/6/12, Tonu Mikk
Alan, thanks for explaining about passing objects to classes. This is an
important concept for me to understand.
I tried running the code, but run into an error that I could not resolve:
TypeError: doIt() takes no arguments (1 given).
Tonu
On Thu, Feb 2, 2012 at 7:09 PM, Alan Gauld wrote:
> O
On 02/02/12 17:36, Tonu Mikk wrote:
So far I have searched for info on how to pass variables from one class
to another and have been able to create a small two class program
(attached). But I seem unable to generalize from here and apply this
to the game exercise. What would you suggest for m
On Feb 2, 2012, at 12:36, Tonu Mikk wrote:
> I feel stumped and don't know how to go about creating this game with two
> classes.
>
> So far I have searched for info on how to pass variables from one class to
> another and have been able to create a small two class program (attached).
> Tha
>I am learning Python using the "Learn Python the Hard Way" book by Zed Shaw.
>I reached exercise 42 where we learn about Python classes. The exercise shows
>a game with one class that includes all the definitions for playing the game.
>For extra credit we are asked to create another version
12 matches
Mail list logo