निम्नलिखित पायथन कोड का आउटपुट क्या होगा?
What will be the output of the following Python code?
>>>t1 = (1, 2, 4, 3)
>>>t2 = (1, 2, 3, 4)
>>>t1 < t2 A
True
B
False
C
Error
D
None
Explanation
The output will be (B) False.
Explanation:
- Python compares tuples element by element.
- In this case,
t1 = (1, 2, 4, 3)andt2 = (1, 2, 3, 4). - Python first compares
1with1(equal), then2with2(equal). - Next, it compares
4(fromt1) with3(fromt2). Since4 > 3, Python concludest1 > t2.
So, the comparison t1 < t2 is False.
Correct Answer: B) False