Test Index
CBSE Class 12 Computer Science 2025 Paper Compartment
© examsnet.com
Question : 23 of 37
Marks:
+1,
-0
Give an example of each of the following :(i) An expression using any one identity operator.(ii) An arithmetic expression which uses any one augmented assignment operator.
Solution:
(i) Identity operators (
is, is not) check whether two names refer to the same object in memory.L1 = [1, 2]L2 = L1print(L1 is L2) # True (same object)print(L1 is not [1, 2]) # True (a different object with equal value)(ii) An augmented assignment operator (
+=, -=, *=, /=, //=, %=, **=) combines an arithmetic operation with assignment.n = 10n += 5 # same as n = n + 5print(n) # 15
© examsnet.com
Go to Question: