Welcome to this quiz on Python Operators!
Operators in Python permit us to carry out operations on variables and values. This quiz will check your understanding of various kinds of operators, together with arithmetic, comparability, logical, bitwise, project, and id operators.
Every query is multiple-choice, and the solutions are offered on the finish. Let’s see how properly you perceive Python operators!
Desk of Contents:
- Python quizzes for freshmen collection
Operators Quiz
Quiz Questions
1. What would be the output of 5 + 3 * 2
?
a) 16
b) 11
c) 13
d) 10
Reply
b) 11
2. Which operator is used for exponentiation in Python?
a) ^
b) **
c) %
d) //
Reply
b) **
3. What’s going to 10 % 3
return?
a) 1
b) 3
c) 0
d) 10
Reply
a) 1
4. What’s the results of 5 // 2
?
a) 2.5
b) 2
c) 3
d) 5
Reply
b) 2
5. What’s the output of not (True and False)
?
a) True
b) False
c) None
d) SyntaxError
Reply
a) True
6. Which operator is used for flooring division?
a) /
b) //
c) %
d) **
Reply
b) //
7. What’s the results of 2 ** 3 ** 2
?
a) 64
b) 512
c) 9
d) 16
Reply
b) 512
8. What does 10 & 7
consider to?
a) 3
b) 2
c) 7
d) 10
Reply
b) 2
9. Which operator is used for bitwise OR?
a) |
b) &
c) ^
d) ~
Reply
a) |
10. What’s the output of 10 | 4
?
a) 14
b) 10
c) 4
d) 6
Reply
a) 14
11. What’s going to True + True
return?
a) 2
b) 1
c) True
d) False
Reply
a) 2
12. What’s the results of 10 > 5 and a pair of < 8
?
a) True
b) False
c) None
d) Error
Reply
a) True
13. What does 10 == "10"
consider to?
a) True
b) False
c) None
d) Error
Reply
b) False
14. What’s the results of not 0
?
a) True
b) False
c) 0
d) 1
Reply
a) True
15. Which operator is used to examine if two variables reference the identical object?
a) ==
b) is
c) in
d) and
Reply
b) is
16. What’s going to 5 & 3
return?
a) 1
b) 3
c) 2
d) 5
Reply
c) 2
17. What’s going to 5 | 3
return?
a) 5
b) 3
c) 7
d) 2
Reply
c) 7
18. What does ~5
consider to?
a) -5
b) -6
c) 6
d) 5
Reply
b) -6
19. What’s going to 10 != 10
return?
a) True
b) False
c) None
d) Error
Reply
b) False
20. What’s going to 8 >> 2
return?
a) 2
b) 4
c) 1
d) 8
Reply
a) 2
How did you do? 🎯
- 18-20 appropriate → 🏆 Glorious! You’re a Python capabilities professional!
- 14-17 appropriate → 👍 Nice job! Maintain working towards.
- 10-13 appropriate → 🙂 Good, however there’s room for enchancment.
- Under 10 → 🤔 No worries! Evaluate the ideas and check out once more.