A Methodical Appoarch


I completed it. But wanted to know why the method description took the argument self only and not name and age as well.

Replace this line with your code.


Only the __init__ function needs parameters so they get instantiated in the class. Methods that use those variables only need self which is the instance object representation.


def __repr__(self):
    return "This is %s with age %s" % (self.name, str(self.age))


Much appreciated mtf


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.