Python Relational and Logical Operator MCQs: 10 Solved Questions
Solve 10 Python operator MCQs step by step. Trace precedence, truthiness, operand-return behaviour, Boolean arithmetic, equality, and invalid symbols.
KnowledgeGate Team
Exam prep & CS education

Python operator MCQs often look like one-line syntax checks, but they mix four decisions: whether a symbol is valid, which operation binds first, whether an operand is truthy, and whether Python returns a Boolean or an original operand. These 10 solved questions target precedence, valid symbols, truthiness, operand returns, equality and Boolean arithmetic. Predict both the type and value before comparing your reduction with each explanation. For the full operator map and a multi-step score program, start with Python Operators and Expressions: Precedence, Types and Worked Output Traces; for focused practice, solve these ten relational and logical MCQs, then continue at the Relational & Logical practice hub for more questions and Coding & DSA Courses for Placements for longer programs.
1. Relational and logical operators in one worked Python trace

Python comparison operators include <, <=, >, >=, ==, and !=. Its logical operators are not, and, and or. Be precise about spelling: => is never the greater-than-or-equal operator. Python uses >=.
For these questions, apply the useful precedence chain comparisons > not > and > or. With x = 8, y = 12, and active = False, trace:
x < y and not active or y == 10
The comparisons reduce it to True and not False or False. Next, not False becomes True. Then True and True becomes True. Finally, True or False gives the Boolean value True. Both operands at the final or are Boolean, so the returned operand is also Boolean.
There is one extra rule that catches many learners. Python's and and or can return operands, not just Boolean values. 10 or 40 returns the integer 10, not Boolean True, because 10 is the first truthy operand. In contrast, '2' == 2 returns Boolean False: a string and an integer are not equal, and this equality test raises neither TypeError nor ValueError.

2. Python operator MCQs 1-2: precedence and valid comparison symbols
Question 1 (RSSB Senior Computer Instructor 2026)
Evaluate the following Boolean expression according to Python operator precedence rules. Identify the correct result from the given options:
True and not True or True
A. True
B. False
C. The given expression raises a TypeError
D. The given expression raises a ValueError
Correct answer: A. True.
Apply precedence one step at a time: not True becomes False; True and False becomes False; and False or True becomes True. Every operand is already Boolean, and each operator is valid for these values, so neither TypeError nor ValueError applies. Review the worked solution on the Relational & Logical module hub (question page unavailable).
Question 2 (RSSB Senior Computer Instructor 2026)
Which of the following options is not a valid relational (comparison) operator in Python?
A.
!=B.
<=C.
==D.
=>
Correct answer: D. =>.
!= means not equal, <= means less than or equal, and == tests equality. Python writes greater than or equal as >=. Reversing those characters to => creates invalid syntax. You can also open the Relational & Logical module hub (question page unavailable).
3. Python operator MCQs 3-4: identify the operator family
Question 3
Identify the logical operator used in Python out of the following.
A.
andB.
inC.
<=D.
+=
Correct answer: A. and.
Sort the choices by family. and is logical, in is membership, <= is comparison, and += is augmented assignment. All four are valid Python operators, but only one belongs to the family named in the stem. Retest the operator-family distinction without options before moving on.
Question 4 (RSSB Senior Computer Instructor 2023)
Which of the following is not a valid operator in Python?
A.
==B.
=>C.
//D.
**
Correct answer: B. =>.
== tests equality, // performs floor division, and ** performs exponentiation. => is invalid because Python uses >=. The answer matches Question 2 even though this time the distractors come from several operator families. See its Relational & Logical module hub (question page unavailable).
4. Python operator MCQs 5-6: short-circuiting and Boolean arithmetic
Question 5 (RSSB Senior Computer Instructor 2026)
In Python programming, let N be an integer variable (identifier). Evaluate the following Boolean expression according to Python operator precedence rules:
10 != 20 or 30 == 40 and not 50 > N
Which of the following statements correctly describes the result of this Boolean expression?
A. Always True
B. Always False
C. True only if 50 > N
D. False only if 50 > N
Correct answer: A. Always True.
Parse it as (10 != 20) or ((30 == 40) and (not (50 > N))). The left side is True, so True or anything is True; Python can short-circuit without evaluating N.
Check both directions. For N = 25, not (50 > 25) is False, so the full reduction is True or (False and False), which is True. For N = 75, that inner result changes to not False, or True, but the full expression is True or (False and True), still True. The Relational & Logical module hub (question page unavailable) includes the worked explanation.
Question 6
What will be the result of the expression?
True + True + False
A.
0B.
1C.
2D.
3
Correct answer: C. 2.
In Python arithmetic, True acts as 1 and False acts as 0. Therefore the exact sum is 1 + 1 + 0 = 2. This is arithmetic addition, not the work of the logical operators and or or, and the rule should not be assumed for every programming language. Retest the sum without options after noting each Boolean's numeric value.
5. Python operator MCQs 7-8: why or can return an operand
Question 7
Identify the correct output of the following Python Command :
print (10 or 40)
A.
10B.
40C.
50D.
400
Correct answer: A. 10.
Both integers are truthy. Python's or returns the first truthy operand instead of converting it to Boolean True. Thus 10 or 40 produces integer 10, which print displays as 10. The operator performs neither addition nor multiplication.
Question 8 (RSSB Senior Computer Instructor 2023)
Identify the correct output of the following Python Command: print (10 or 40)
A.
10 / 10B.
40 / 40C.
50 / 50D.
400 / 400
Correct answer: A. 10 / 10 .
The slash in each option separates two displayed versions of the same value; it is not division. The operand-return rule gives 10, so choose the option whose two displayed values are both 10. The Relational & Logical module hub (question page unavailable) preserves the original option display.
6. Python operator MCQs 9-10: equality is not identity or coercion
Question 9 (HPSC PGT Computer Science 2024)
In Python "==" operator returns true if:
----------------------------------------
पायथन में "==" ऑपरेटर सत्य देता है यदि :
A. Variables are aliases for same object / वेरिएबल एक ही ऑब्जेक्ट के उपनाम हैं
B. Content of two different objects are same / दो भिन्न ऑब्जेक्ट्स के कंटेंट समान हैं
C. Options (1) & (2) are correct / विकल्प (1) व (2) सही हैं
D. All options are wrong / सभी विकल्प गलत हैं
Correct answer: C. Options (1) & (2) are correct / विकल्प (1) व (2) सही हैं.
The intended distinction is between equality and identity. == tests values or contents, while is tests whether two names refer to the same object. With a = [1, 2], b = a, and c = [1, 2], both a == b and a == c are True, while a is c is False. Aliases normally compare equal, and distinct objects can compare equal when their contents match. For the ordinary list objects in this example, option C is correct; is remains the operator that directly tests aliasing. Review the Relational & Logical module hub (question page unavailable).
Question 10
In Python, what happens when the expression '2' == 2 is executed?
A. False
B. True
C. ValueError occurs
D. TypeError occurs
Correct answer: A. False.
The left operand is string '2'; the right operand is integer 2. Python does not silently coerce one to the other for equality, so the result is Boolean False. Comparing these types with == is valid, so neither exception is raised. Use Python Output-Based Questions as your next output-prediction drill. Retest the equality expression without options after stating both operand types.
7. The short version and the next practice step
Keep this six-line error ledger:
Mistake: writing
=>. Correction: greater than or equal is>=.Mistake: treating
inas logical. Correction: it is a membership operator.Mistake: reading only left to right. Correction: apply
comparisons > not > and > or.Mistake: expecting
andororto return only a Boolean. Correction: preserve and inspect the original operands.Mistake: treating
TrueandFalseas non-numeric. Correction: in Python arithmetic they act as1and0.Mistake: expecting
'2' == 2to coerce or fail. Correction: it returnsFalsewithout an exception.
Use a 12-minute drill. Spend 6 minutes answering all 10 questions, 4 minutes writing the first wrong reduction step for each miss, and 2 minutes rerunning only the missed expressions in a Python shell. The next day, retest those missed items without options.
In short, validate the operator spelling, mark operand types and truthiness, apply comparisons > not > and > or, and preserve original operands when tracing and or or. Use the Python Course for structured concept revision, or follow Coding for Placements for broader placement preparation.
Keep learning
Operator Precedence MCQs: 10 Solved Grammar and Parse-Tree Questions
Solve 10 published Operator Precedence questions on grammar rules, precedence, associativity, parser facts, and expression trees, with fresh explanations.
Division Operator MCQs: 10 Solved Questions with Explanations
Solve ten published Division Operator MCQs, then use the worked missing-pair method to diagnose errors in universal queries, schemas, and cardinality.
Division Operator in Relational Algebra: Worked DBMS Example and Exam Traps
Learn relational division by solving one student-course dataset three ways, then test your understanding against extra tuples, duplicates, and an empty divisor.
Safety of Expressions & Power MCQs: 10 Solved Relational Calculus Questions
Practise the active-domain test, De Morgan rewrites and the equivalence of relational algebra, safe TRC and safe DRC through ten fully explained questions.





