[Tutor] Python object

James Reynolds eire1130 at gmail.com
Thu Feb 24 17:13:47 CET 2011


I don't understand what you are trying to do?

I'm assuming def GetAllAtrib is a method within a class; perhaps you could
copy more the code base?

It seems to be locating the three elements you have in that method just
fine, but I'm guessing you have another print statement somewhere that is
causing it to print None.


On Thu, Feb 24, 2011 at 10:48 AM, Christopher Brookes <
chris.klaitos at gmail.com> wrote:

> Hi, i'm new in python.
> I'm trying to create a small fight program in object.
>
> I've created __init__ (its works) but when i'm trying to display init param
> i'm getting param and "None" every time. Why ?
>
> def GetAllAtrib(self):
>         print '-----------------------------------------------'
>         print self.name
>         print self.description
>         print self.type
>         print '-----------------------------------------------'
>
> give ->>
>
> -----------------------------------------------
> Klaitos
> Soldier very strong
> Soldier
> -----------------------------------------------
> *None                                           *<<<<<<<<-- WHY ARE U HERE
> ??
>
> Yours,
>
>
>
> --
> Brookes Christopher.
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20110224/c106c473/attachment.html>


More information about the Tutor mailing list