निम्नलिखित पायथन कोड का आउटपुट क्या होगा?
What will be the output of the following Python code?
>>>t1 = (1, 2, 4, 3)
>>>t2 = (1, 2, 3, 4)
>>>t1 < t2
A)
B)
C)
D)
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
1
with1
(equal), then2
with2
(equal). - Next, it compares
4
(fromt1
) with3
(fromt2
). Since4 > 3
, Python concludest1 > t2
.
So, the comparison t1 < t2
is False.