Sunil Tech writes:
> Thanks I got it.
Thanks for telling us!
You should know that ‘super’ is a topic that confuses even quite
experienced Python programmers. It is good to encounter this early, when
you can learn about it.
See the article “Python’s super() considered super!”
https://rhettinger
Thanks I got it.
class Cain(Adam):
"""docstring for Cain"""
def __init__(self, age, *args):
super(Cain, self).__init__(*args)
self.age = age
a = Adam('Eve')
c = Cain(12, 'Eve')
print a.name, c.age, c.name
>>> Eve 12 Eve
On Fri, Nov 27, 2015 at 12:44 PM, Sunil Tech
wrot
class Adam(object):
"""docstring for Adam"""
def __init__(self, name):
self.name = name
class Cain(Adam):
"""docstring for Cain"""
def __init__(self, age, *args):
super(Cain, self).__init__(age, *args)
self.age = age
a = Adam('Eve')
c = Cain(12)
print a.n