Christopher Brookes 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
My crystall ball says: because you invoke the above method with something like print soldier.GetAllAttrib() instead of just soldier.GetAllAttrib() If I'm guessing wrong please provide the relevant source code. By the way, show_all_attributes() would be a better name for your method as it would make the problem in your code obvious. _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor