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.name, c.age, c.name
>>> Eve 12 12

May i know why c.name is 12?
I am expecting Eve.

Help me to understand.


Thanks,
Sunil. G
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to