ExamVeda
Login
Home
21
What is the purpose of the modulo operator (%) in Python?
Discuss
Answer & Solution
Answer: Option D
Solution:
The % operator calculates the remainder of division.
22
What is the result of round(3.75) ?
Discuss
Answer & Solution
Answer: Option C
Solution:
The round() function rounds a floating-point number to the nearest integer.
23
What is the output of this expression, 3*1**3?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
24
What is the purpose of the == operator in Python?
Discuss
Answer & Solution
Answer: Option B
Solution:
The == operator is used to compare if two values are equal.
25
Which of the following is invalid?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
26
What is the result of not (5 > 3) ?
Discuss
Answer & Solution
Answer: Option B
Solution:
The not operator returns the opposite of its operand's boolean value.
27
Which of the following is a valid way to comment a single line in Python?
Discuss
Answer & Solution
Answer: Option D
Solution:
The # symbol is used to comment a single line in Python.
28
Which one of the following has the same precedence level?
Discuss
Answer & Solution
Answer: Option A
Solution:
In Python, Addition (+) and Subtraction (-) operators have the same precedence level.

Multiplication (*) and Division (/) operators have a higher precedence than Addition and Subtraction.

When an expression contains operators with the same precedence, they are evaluated from left to right.

For example, in the expression 3 + 5 - 2, the addition and subtraction are performed from left to right.
29
Which of the following is an invalid variable?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
30
What is the result of "hello" * 3 ?
Discuss
Answer & Solution
Answer: Option A
Solution:
The * operator repeats a string a specified number of times.