53- Which method is used to return a string with the first letter capitalized?
Anonymous Quiz
70%
a) capitalize()
11%
b) upper()
0%
c) noscript()
20%
d) first_upper()
56- In Python, single-line comments are created using the # symbol.
Anonymous Quiz
88%
a) True
13%
b) False
58- The for loop in Python can be used to iterate over strings.
Anonymous Quiz
89%
a) True
11%
b) False
60- The in operator is used to check if a value exists within a list.
Anonymous Quiz
82%
a) True
18%
b) False
62- A method in a class cannot be called without creating an instance of the class.
Anonymous Quiz
61%
a) True
39%
b) False
63- The __init__ method in Python is called the constructor of a class.
Anonymous Quiz
87%
a) True
13%
b) False
64- In Python OOP, encapsulation means hiding the class data by making attributes private.
Anonymous Quiz
87%
a) True
13%
b) False
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