65- Inheritance allows a new class to extend the properties and methods of an existing class.
Anonymous Quiz
87%
a) True
13%
b) False
66- What does the __init__() method in a Python class do?
Anonymous Quiz
6%
a) Deletes an object
91%
b) Initializes the class attributes
4%
c) Prints a message
0%
d) Compares two objects
67- Which of the following statements is true about class attributes?
Anonymous Quiz
25%
a) They belong to a specific object instance
64%
b) They are shared among all instances of a class
7%
c) They cannot be changed
4%
d) They are defined inside methods only
👎6
69- What is the correct syntax to create an instance of the class Mobile with the name "Nokia"?
Anonymous Quiz
26%
a) nokia = Mobile()
52%
b) nokia = Mobile("Nokia")
21%
c) nokia = Mobile.Nokia()
2%
d) nokia = Mobile[Nokia]
70- In Python, the __del__() method is called when an object is destroyed.
Anonymous Quiz
67%
a) True
33%
b) False
71- The self keyword allows access to the attributes and methods of the class instance.
Anonymous Quiz
80%
a) True
20%
b) False
72- Method override allows two methods with the same name but different arguments in one class.
Anonymous Quiz
61%
a) True
39%
b) False
73- In Python, inheritance allows a class to inherit attributes and methods from a parent class.
Anonymous Quiz
91%
a) True
9%
b) False
74- What does self refer to in a class method?
Anonymous Quiz
14%
a) A local variable
20%
b) The class itself
63%
c) The instance of the class
3%
d) A global variable
75- Static methods do not need self as their first parameter.
Anonymous Quiz
80%
a) True
20%
b) False
77- Polymorphism refers to the ability to use a single method or operator with different objects.
Anonymous Quiz
77%
a) True
23%
b) False
78- In Python, super() can be used even when there is no method name conflict between the parent and child classes.
Anonymous Quiz
63%
a) True
37%
b) False
79- Abstract classes in Python cannot have any methods implemented.
Anonymous Quiz
52%
a) True
48%
b) False
🤔1
81- In Python, method overriding allows a subclass to define its own version of a method.
Anonymous Quiz
90%
a) True
10%
b) False
_ represents an entity in the real world with its identity and behaviour.
Anonymous Quiz
8%
A method
64%
An object
18%
A class
11%
An operator
_ is used to create an object.
Anonymous Quiz
51%
class
31%
constructor
15%
User-defined functions
3%
In-built functions
What is setter used for?
Anonymous Quiz
31%
To access the attribute of the object
46%
To set an attribute
19%
To check if an attribute exists or not
4%
To delete an attribute