Python Programming - Classes - Discussion

Discussion Forum : Classes - General Questions (Q.No. 5)
5.
How can you inherit a class?
Using the inherit keyword.
By using the extends keyword.
Using the inherits keyword.
By placing the parent class name in parentheses after the child class name.
Answer: Option
Explanation:
In Python, class inheritance is achieved by placing the name of the parent class in parentheses after the name of the child class. This creates a relationship where the child class inherits attributes and methods from the parent class.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.