5- Which method is called when an object is created?
Anonymous Quiz
83%
A) __init__
7%
B) __new__
8%
C) __create__
1%
D) __build__
6- What is the purpose of an abstract class in Python?
Anonymous Quiz
78%
a) To define methods that must be implemented by any subclass
12%
b) To prevent the creation of subclasses
6%
c) To provide a method for object deletion
3%
d) To store static data
7- What does the super() function refer to in Python?
Anonymous Quiz
76%
A) The parent class
7%
B) The current class
15%
C) The current instance
1%
D) A sibling class
8- Which of the following is NOT an example of polymorphism in Python?
Anonymous Quiz
13%
A) Method overriding
1%
B) Method overloading
21%
C) Operator overloading
64%
D) Creating multiple instances of a class
9- What is the purpose of the super() function in Python?
Anonymous Quiz
19%
A) To call the parent class’s constructor
40%
B) To access methods and properties from the parent class
1%
C) To create a new instance of a class
40%
D) Both A and B
12- Python supports both procedural and object-oriented programming paradigms.
Anonymous Quiz
87%
A) True
13%
B) False
👎1
13- The import statement in Python is used to include external modules or libraries in a noscript.
Anonymous Quiz
81%
A) True
19%
B) False
❤1
14- Which of the following is a valid way to define a Python function?
Anonymous Quiz
12%
a) def function_name[]:
9%
b) function function_name():
77%
c) def function_name():
2%
d) function_name def():
15- How do you create a new list with the values [1, 2, 3]?
Anonymous Quiz
84%
a) list = [1, 2, 3]
12%
b) list = (1, 2, 3)
4%
c) list = {1, 2, 3}
0%
d) list = 1, 2, 3
👏1
19- Which operator is used for floor division in Python?
Anonymous Quiz
10%
a) /
85%
b) //
1%
c) %
3%
d) ^
20- Which function is used to get the data type of an object?
Anonymous Quiz
79%
a) type()
6%
b) id()
6%
c) data()
9%
d) class()
22- How do you create a dictionary in Python?
Anonymous Quiz
8%
a) dict = [key1: value1, key2: value2]
82%
b) dict = {key1: value1, key2: value2}
8%
c) dict = (key1: value1, key2: value2)
3%
d) dict = <key1: value1, key2: value2>
23- Which method removes the last item from a list?
Anonymous Quiz
73%
a) pop()
18%
b) remove()
8%
c) delete()
2%
d) discard()
24- What does the split() method do?
Anonymous Quiz
5%
a) Joins a list into a string
73%
b) Splits a string into a list
11%
c) Converts string to uppercase
11%
d) Replaces parts of a string
25- Which operator is used to check if two values are equal?
Anonymous Quiz
0%
a) =
91%
b) ==
3%
c) !=
5%
d) ===
26- What is the output of print(bool([]))?
Anonymous Quiz
12%
a) True
72%
b) False
2%
c) 0
14%
d) None
27- Which of the following is not a valid Python variable name?
Anonymous Quiz
5%
a) variable_name
5%
b) VariableName
79%
c) variable-name
10%
d) _variableName