How does inheritance work in python?



How does inheritance work in python?..

Answer / Kalpana Bharti

Inheritance in Python allows one class (the subclass or derived class) to acquire the properties and methods of another class (the superclass or base class). To create a subclass, use the 'class' keyword followed by the name of the new class, and then '(superclass)' with a colon. Subsequent property and method definitions within the subclass will be created as extensions to those already in the superclass.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Python Interview Questions

Why do lambda forms in python not have the statements?

1 Answers  


Is cython as fast as c?

1 Answers  


What is tkinter?

1 Answers  


Is python zero indexed?

1 Answers  


Is indentation required in python?

1 Answers  


Is python scripting easy to learn?

1 Answers  


What is the python decorator?

1 Answers  


Explain about pdb module in python?

1 Answers  


How will you find, in a string, the first word that rhymes with ‘cake’?

1 Answers  


Is true a keyword in python?

1 Answers  


What is the use of dir() function?

1 Answers  


Do sets, dictionaries and tuples also support comprehensions?

1 Answers  


Categories