Python Basic Operators MCQs - 25 Multiple Choice Questions
1. What is the output of `5 + 3`?
A) 8
B) 53
C) 5
D) None of the above
Answer: A
A) 8
B) 53
C) 5
D) None of the above
Answer: A
2. Which operator is used for exponentiation in Python?
A) ^
B) **
C) exp
D) None of the above
Answer: B
A) ^
B) **
C) exp
D) None of the above
Answer: B
3. What will be the result of `10 // 3`?
A) 3
B) 3.33
C) 3.0
D) 4
Answer: A
A) 3
B) 3.33
C) 3.0
D) 4
Answer: A
4. Which operator is used for string concatenation?
A) +
B) &
C) .
D) ,
Answer: A
A) +
B) &
C) .
D) ,
Answer: A
5. What is the result of `True + 1`?
A) True
B) 1
C) 2
D) Error
Answer: C
A) True
B) 1
C) 2
D) Error
Answer: C
6. What will `4 * (3 + 2)` evaluate to?
A) 20
B) 16
C) 10
D) 12
Answer: A
A) 20
B) 16
C) 10
D) 12
Answer: A
7. Which operator is used for logical AND in Python?
A) &&
B) &
C) and
D) ||
Answer: C
A) &&
B) &
C) and
D) ||
Answer: C
8. What will be the output of `3 * 1 ** 3`?
A) 3
B) 9
C) 1
D) 27
Answer: A
A) 3
B) 9
C) 1
D) 27
Answer: A
9. What does the operator `%` represent?
A) Modulus
B) Division
C) Exponentiation
D) None of the above
Answer: A
A) Modulus
B) Division
C) Exponentiation
D) None of the above
Answer: A
10. What is the output of `5 == 5`?
A) True
B) False
C) 1
D) 0
Answer: A
A) True
B) False
C) 1
D) 0
Answer: A
11. Which operator is used for bitwise OR?
A) |
B) ||
C) or
D) &
Answer: A
A) |
B) ||
C) or
D) &
Answer: A
12. What will be the output of `3 != 4`?
A) True
B) False
C) 0
D) 1
Answer: A
A) True
B) False
C) 0
D) 1
Answer: A
13. What does `not True` evaluate to?
A) True
B) False
C) 1
D) 0
Answer: B
A) True
B) False
C) 1
D) 0
Answer: B
14. Which operator would you use to check if two values are the same object?
A) ==
B) is
C) equals
D) None of the above
Answer: B
A) ==
B) is
C) equals
D) None of the above
Answer: B
15. What is the output of `9 // 2`?
A) 4.5
B) 4
C) 5
D) 0
Answer: B
A) 4.5
B) 4
C) 5
D) 0
Answer: B
16. What does `5 < 10` return?
A) True
B) False
C) 1
D) None of the above
Answer: A
A) True
B) False
C) 1
D) None of the above
Answer: A
17. Which operator is used for floor division?
A) /
B) //
C) %
D) None of the above
Answer: B
A) /
B) //
C) %
D) None of the above
Answer: B
18. What will be the output of `len("Hello")`?
A) 5
B) 4
C) 6
D) None of the above
Answer: A
A) 5
B) 4
C) 6
D) None of the above
Answer: A
19. What is the output of `2 ** 3`?
A) 8
B) 9
C) 6
D) 7
Answer: A
A) 8
B) 9
C) 6
D) 7
Answer: A
20. What does the `in` keyword check?
A) Membership in a list or string
B) Equality between two values
C) Comparison between two variables
D) None of the above
Answer: A
A) Membership in a list or string
B) Equality between two values
C) Comparison between two variables
D) None of the above
Answer: A
21. What is the output of `5 + 10 * 2`?
A) 20
B) 25
C) 15
D) 10
Answer: C
A) 20
B) 25
C) 15
D) 10
Answer: C
22. What is the operator for logical NOT?
A) !
B) not
C) ~
D) None of the above
Answer: B
A) !
B) not
C) ~
D) None of the above
Answer: B
23. Which operator is used to assign a value to a variable?
A) :
B) =
C) ==
D) =>
Answer: B
A) :
B) =
C) ==
D) =>
Answer: B
24. What will be the output of `x = 10; y = 2; print(x % y)`?
A) 5
B) 0
C) 2
D) 10
Answer: B
A) 5
B) 0
C) 2
D) 10
Answer: B
25. What does `==` check for?
A) Identity
B) Equality
C) None of the above
D) Both A and B
Answer: B
A) Identity
B) Equality
C) None of the above
D) Both A and B
Answer: B
0 Comments