Why are local variable names beginning with an underscore discouraged?
Anonymous Quiz
6%
they confuse the interpreter
13%
they are used to indicate global variables
79%
they are used to indicate a private variables of a class
3%
they slow down execution
All keywords in Python are in _____
Anonymous Quiz
34%
lower case
6%
UPPER CASE
21%
Capitalized
39%
None of the mentioned
Which of the following is true for variable names in Python?
Anonymous Quiz
25%
all private members must have leading and trailing underscores
18%
unlimited length
41%
underscore and ampersand are the only two special characters allowed
16%
none of the mentioned
Which of the following is an invalid statement?
Anonymous Quiz
13%
abc = 1,000,000
54%
a b c = 1000 2000 3000
22%
a,b,c = 1000, 2000, 3000
11%
a_b_c = 1,000,000
Which of the following cannot be a variable name in Python?
Anonymous Quiz
45%
init
11%
it
8%
on
36%
in
Which is the correct operator for power(x power y) in Python?
Anonymous Quiz
9%
x^y
86%
x**y
5%
x^^y
0%
None of the mentioned
the order of precedence in python?
Parentheses, Exponential, Multiplication , Division , Addition, Subtraction
Parentheses, Exponential, Multiplication , Division , Addition, Subtraction
Anonymous Quiz
90%
True
10%
False
Mathematical operations be directly performed on a string in Python without conversion.
Anonymous Quiz
53%
True
47%
False
👏1
Which one of the following has the same precedence level?
Anonymous Quiz
50%
Addition and Subtraction
16%
Multiplication, Division and Addition
29%
Multiplication, Division, Addition and Subtraction
5%
Addition and Multiplication
The expression int(x) implies that the value of variable x is converted to integer.
Anonymous Quiz
89%
True
11%
False
Which one of the following has the highest precedence in the expression?
Anonymous Quiz
22%
Exponential
7%
Addition
62%
Parentheses
8%
Multiplication
1- Which of the following is NOT a feature of OOP in Python?
Anonymous Quiz
5%
A) Inheritance
5%
B) Polymorphism
87%
C) Procedural Programming
3%
D) Encapsulation
2- Which of the following defines encapsulation?
Anonymous Quiz
29%
A) Grouping data and functions that operate on the data in a single unit
18%
B) Allowing a subclass to inherit properties of a superclass
4%
C) Allowing multiple methods to have the same name
49%
D) Restricting access to some of an object’s components
3- In Python, how is inheritance implemented?
Anonymous Quiz
1%
A) Using the self keyword
11%
B) Using the __init__ method
4%
C) Using the colon :
83%
D) By specifying the parent class in parentheses after the child class name
4- What does polymorphism mean in Python?
Anonymous Quiz
4%
A) One class can inherit from multiple classes
84%
B) The ability to define methods that have the same name but act differently
0%
C) The ability to hide data within a class
12%
D) All of the above
❤1
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