Python OOPs Concepts
Python OOPs Concepts - Important Points
21. | What is inheritance in Python? |
---|
A. The process of creating a new class from an existing class
B. The process of deleting a class
C. The process of creating an object from a class
D. None of the above
View Answer Discuss Work SpaceAnswer: option a
Explanation:
22. | Which keyword is used to inherit from a class in Python? |
---|
A. parent
B. base
C. extend
D. None of the above
View Answer Discuss Work SpaceAnswer: option d
Explanation:
23. | What is method overriding in Python? |
---|
A. The process of defining a new method in a subclass with the same name as a method in the parent class
B. The process of deleting a method in a subclass
C. The process of creating a new method in a subclass with a different name than a method in the parent class
D. None of the above
View Answer Discuss Work SpaceAnswer: option a
Explanation:
24. | Which method is called when an object is compared to another object in Python? |
---|
A. eq
B. cmp
C. ne
D. lt
View Answer Discuss Work SpaceAnswer: option a
Explanation:
25. | What is encapsulation in Python? |
---|
A. The process of hiding the implementation details of a class from its users
B. The process of exposing the implementation details of a class to its users
C. The process of creating a new class from an existing class
D. None of the above
View Answer Discuss Work SpaceAnswer: option a
Explanation: