- 1

can any 1 can give an example of code using super()?

14th Jun 2017, 2:59 AM
Nithya Mk
Nithya Mk - avatar
3 Answers
+ 1
class Mammal: def __init__(self, mammalName): print(mammalName, 'is a warm-blooded animal.') class Dog(Mammal): def __init__(self): print('Dog has four legs.') super().__init__('Dog') d1 = Dog()
28th Jun 2017, 7:58 AM
Srivatsa Alluru
0
class A: def method(self): print("A method") class B(A): def another_method(self): print("B method") class C(B): def third_method(self): print("C method") c = C() c.method() c.another_method() c.third_method() here A is super class
16th Jun 2017, 4:11 PM
MD. WOALID HOSSAIN
MD. WOALID HOSSAIN - avatar