📜  元组比较python代码示例

📅  最后修改于: 2022-03-11 14:47:07.337000             🧑  作者: Mango

代码示例1
'''In python, tuples are compared item by item, by the order of the index
0 with 0, 1 with 1...
Here are some examples'''
>>> (2, 4) < (1, 5)
False # Because 1 < 2
>>> (2, 4) < (2, 5)
True # Because 4 < 5
'''Length does not really matters, False is returned for the first comparison
that fails'''
>>> (2, 4, 120) < (2, 5, 0)
True
>>> (2, 4, 120) < (2, 5)
True