โ Computational Thinking & Programming-I Quiz 4 โ Python Operators (Class 11 CS)
Practice 20 CBSE Class 11 Computer Science (Code 083) MCQs on Python operators โ arithmetic, relational, logical, assignment, augmented assignment, identity (is, is not), and membership (in, not in) operators.
Every expression below has been verified by actually running it in Python. Tap any question to reveal the answer with a clear explanation.
โ Arithmetic
Which of the following is an arithmetic operator in Python?
- and
- not
- +
- is
Show Answer & Explanation
โ Answer: (c) +
+ is an arithmetic operator, used for addition (and string/list concatenation). and, not, and is are logical/identity operators, not arithmetic ones.
โ Arithmetic
What is the result of the expression 10 / 3 in Python?
- 3
- 3.333
- 3.0
- 4
Show Answer & Explanation
โ Answer: (b) 3.333
The / operator always performs true (floating-point) division in Python 3, so 10 / 3 gives 3.333… โ not a whole number, even though both operands are integers.
โ Arithmetic
Which operator is used for exponentiation in Python?
- **
- %
- /
- +
Show Answer & Explanation
โ Answer: (a) **
** is Python’s exponentiation operator โ for example, 2 ** 3 gives 8 (2 raised to the power 3).
โ Arithmetic
What is the result of the expression 8 // 3 in Python?
- 2
- 2.666
- 3
- 8
Show Answer & Explanation
โ Answer: (a) 2
// is the floor division operator โ it divides and then rounds down to the nearest whole number, discarding the remainder. 8 รท 3 = 2.666…, floored to 2.
โ๏ธ Relational
Which of the following is a relational operator in Python?
- %
- and
- <
- or
Show Answer & Explanation
โ Answer: (c) <
< (less than) is a relational (comparison) operator, used to compare two values. % is arithmetic, while and/or are logical operators.
โ๏ธ Relational
What is the result of the expression 5 > 3 in Python?
- True
- False
- None
- Error
Show Answer & Explanation
โ Answer: (a) True
5 is indeed greater than 3, so this comparison evaluates to the boolean True.
โ๏ธ Relational
Which operator is used for checking if two values are equal in Python?
- !=
- >
- ==
- <
Show Answer & Explanation
โ Answer: (c) ==
== (double equals) checks equality between two values. A single = is only for assignment, and != checks the opposite โ inequality.
๐ Logical
Which operator is used to combine multiple conditions in Python?
- or
- and
- not
- is
Show Answer & Explanation
โ Answer: (b) and
Both and and or combine multiple conditions, but and is the operator that specifically requires all combined conditions to be true (whereas or only needs one). Given the single-answer format, and is the standard textbook example for this concept.
๐ Logical
What is the result of the expression True and False in Python?
- True
- False
- None
- Error
Show Answer & Explanation
โ Answer: (b) False
and only returns True when both sides are true. Since one side is False here, the result is False.
๐ฅ Assignment
Which operator is used for assigning a value to a variable in Python?
- =
- ==
- +=
- *
Show Answer & Explanation
โ Answer: (a) =
A single = is the assignment operator, storing a value into a variable. == checks equality, and += is an augmented (combined) assignment operator.
๐ฅ Assignment
What is the result of the expression x += 3 if x is initially 5 in Python?
- 8
- 3
- 15
- Error
Show Answer & Explanation
โ Answer: (a) 8
x += 3 is shorthand for x = x + 3. Starting from 5, this gives 5 + 3 = 8.
๐ชช Identity
Which operator is used to check if two objects are the same in Python?
- is
- ==
- !=
- or
Show Answer & Explanation
โ Answer: (a) is
is is the identity operator โ it checks whether two variables point to the exact same object in memory, not just whether their values are equal (that’s what == checks).
๐ Membership
What is the result of the expression 2 in [1, 2, 3] in Python?
- True
- False
- None
- Error
Show Answer & Explanation
โ Answer: (a) True
in checks membership โ since 2 is present in the list [1, 2, 3], the expression evaluates to True.
๐ Membership
Which operator is used to check if an element is not present in a collection in Python?
- not in
- in
- !=
- ==
Show Answer & Explanation
โ Answer: (a) not in
not in is the membership operator that checks for absence โ it returns True if the value is not found in the collection.
๐ชช Identity
What is the result of the expression 3 is not 4 in Python?
- True
- False
- None
- Error
Show Answer & Explanation
โ Answer: (a) True
is not checks that two objects are different. Since 3 and 4 are clearly not the same object, this evaluates to True.
โ Arithmetic
What is the result of the expression 17 % 5 in Python?
- 3
- 2
- 5
- 3.4
Show Answer & Explanation
โ Answer: (b) 2
% is the modulus operator โ it returns the remainder after division. 17 รท 5 = 3 remainder 2.
๐ Logical
What is the result of the expression True or False in Python?
- True
- False
- None
- Error
Show Answer & Explanation
โ Answer: (a) True
or returns True if at least one side is true. Since one side here is True, the whole expression is True.
๐ Logical
What is the result of the expression not True in Python?
- True
- False
- None
- Error
Show Answer & Explanation
โ Answer: (b) False
not flips a boolean value โ not True gives False.
๐ฅ Assignment
What is the result of the expression x *= 2 if x is initially 6 in Python?
- 8
- 2
- 12
- 36
Show Answer & Explanation
โ Answer: (c) 12
x *= 2 is shorthand for x = x * 2. Starting from 6, this gives 6 ร 2 = 12.
๐ชช Identity
If a = [1, 2] and b = [1, 2] (two separately created lists with the same values), what does a == b return, and what does a is b return?
- True and True
- False and False
- True and False
- False and True
Show Answer & Explanation
โ Answer: (c) True and False
a == b checks whether the values are equal โ both lists contain [1, 2], so this is True. But a is b checks whether they’re the same object in memory โ since they were created separately, this is False. This is a classic distinction tested in CBSE exams between equality and identity.
