Python OOPs Concepts
Python OOPs Concepts - Important Points
31. | Which of the following is true about multiple inheritance in Python? |
---|
A. A class can inherit from multiple classes at the same time
B. A class can inherit from only one class at a time
C. Multiple inheritance is not supported in Python
D. None of the above
View Answer Discuss Work SpaceAnswer: option a
Explanation:
32. | Which of the following is true about abstract classes in Python? |
---|
A. An abstract class cannot be instantiated
B. An abstract class must contain at least one abstract method
C. An abstract class can be inherited by another class
D. All of the above
View Answer Discuss Work SpaceAnswer: option d
Explanation:
33. | Which of the following is a decorator in Python? |
---|
A. @classmethod
B. @staticmethod
C. @property
D. All of the above
View Answer Discuss Work SpaceAnswer: option d
Explanation:
34. | Which of the following is true about the init method in Python? |
---|
A. It is called when an object is created from a class
B. It is called when an object is deleted
C. It is used to define instance variables
D. None of the above
View Answer Discuss Work SpaceAnswer: option a
Explanation:
35. | Which of the following is true about instance variables in Python? |
---|
A. They are defined inside the class but outside any method
B. They are shared by all instances of a class
C. They are accessed using the class name
D. None of the above
View Answer Discuss Work SpaceAnswer: option a
Explanation: