Question

    What is inheritance in Python?

    A When one class can use the methods and attributes of another class Correct Answer Incorrect Answer
    B When one class can use the methods and attributes of another class Correct Answer Incorrect Answer
    C When one class can only use the attributes of another class Correct Answer Incorrect Answer
    D When one class cannot use the methods and attributes of another class Correct Answer Incorrect Answer
    E When one class is the same as another class Correct Answer Incorrect Answer

    Solution

    Explanation: Inheritance is a mechanism in Python where one class can inherit the methods and attributes of another class. This allows for code reuse and facilitates the creation of a hierarchy of classes.

    Practice Next