I have written some python code:
class key(object):
def __init__(self,name):
object.__init__(self,age)
this.name = name
this.age = age
def somefunction(self):
print "yay the name is %d" % self.name
baby = key('radan',20)
baby.somefunction()
When I create an instance of key
with baby = key('radan',20)
, I got a TypeError. I don't know why I am getting this error. Is it because of object.__init__(self,age)
?
If yes, please help me in explaining why we use object.__init__(self,age)
and what the purpose of that is and help me solve this code.