Table of Contents
ToggleQuestion 1
Which of the following statements is correct regarding the object-oriented programming concept in Python?
- Classes are real-world entities while objects are not real
- Objects are real-world entities while classes are not real
- Both objects and classes are real-world entities
- All of the above
2. Objects are real-world entities while classes are not real
Question 2
What is Instantiation in terms of OOP terminology?
- Deleting an instance of class
- Modifying an instance of class
- Copying an instance of class
- Creating an instance of class
4. Creating an instance of class
Question 4
How to declare a private variable in python, Using *?
- private keyword
- __ (double underscore)
- _ (single underscore)
- none of the above
2. __ (double underscore)
Question 5
Which keyword is used to access members of the base class?
- self
- pass
- super
- assert
3. super
Question 8
Is that true __init__() function automatically called when an object is created?
- True
- False
- True
Question 9
What is the method inside the class in the python language?
- Object
- Function
- Attribute
- Argument
2. Function
Question 10
Which of the following accepts functions definition?
- Module
- Class
- Another function
- All of the mentioned
4. All of the mentioned
Question 12
What are the methods which begin and end with two underscore characters called?
- Special methods
- In-built methods
- User-defined methods
- Additional methods
- Special methods
Question 13
Which of the following best suits for inheritance?
- Ability of a class to derive members of another class as a part of its own definition
- Means of bundling instance variables and methods in order to restrict access to certain class members
- Focuses on variables and passing of variables to functions
- Allows for implementation of elegant software that is well designed and easily modified
- Ability of a class to derive members of another class as a part of its own definition
Question 14
The class from which the child class inherits is called ________ *?
- Child class
- Parent class
- Super class
- Base class
- ii) iii) and iv
5. ii) iii) and iv
Question 15
Which of these is not a fundamental feature of OOP?
- Encapsulation
- Inheritance
- Instantiation
- Polymorphism
3. Instantiation
Question 16
What is the best suitable answer to function overloading?
- Inheritance may or may not be required.
- Inheritance always required
- Both are correct
- Neither of these two
- Inheritance may or may not be required.
Question 17
What is the best suitable answer to overriding?
- When two or more methods in the same class have the same name but different parameters
- When the method signature (name and parameters) are the same in the superclass and the child class
- Both are correct
- Neither of these two
- When two or more methods in the same class have the same name but different parameters
Question 18
What is the best suitable answer to function overloading?
- There is no need for more than one class.
- There is a need for at least two classes.
- Both are correct
- Neither of these two
- There is no need for more than one class.
Question 19
What is the best suitable answer to function overloading?
- When two or more methods in the same class have the same name but different parameters
- When the method signature (name and parameters) are the same in the superclass and the child class
- Both are correct
- Neither of these two
2. When the method signature (name and parameters) are the same in the superclass and the child class
Question 20
The assignment of more than one function to a particular operator is _____?
- Operator over-assignment
- Operator overriding
- Operator overloading
- Operator instance
3. Operator overloading
Question 21
Which of the following is/are contents of polymorphism.
- method overloading
- method overriding
- both above
- none of the above
3. both above
If you find anything wrong in this Answer Key, feel free to reach us in the comment section.