[Tutor] exercise with classes
Alexander Etter
rhettnaxel at gmail.com
Thu Feb 2 23:23:46 CET 2012
On Feb 2, 2012, at 12:36, Tonu Mikk <tmikk at umn.edu> wrote:
<snip>
> 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).
<snip>
> Thank you,
> Tonu
> <classes_test.py>
> ______________________________
Hi Tonu.
I'm fairly certain that your second class is missing the most important function of a class, the __init__ function! It's necessary to initialize the object. Add it to your second class and see how it changes things.
Alexander
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20120202/d199ee8a/attachment.html>
More information about the Tutor
mailing list