炎炎设计
Comparing tuples
A comparison operator in Python can work with tuples.The comparison starts with a first element of each tuple. If they do not compare to =,
then it proceed to the second element and so on.It starts with comparing the first element from each of the tuplesLet's
study this with an example-
#case 1
a=(5,6)
b=(1,4)
if (a>b):print("a is bigger")
else: print("b is bigger")
#case 2
a=(5,6)
b=(5,4)
if (a>b):print("a is bigger")
else: print ("b is bigger")
#case 3
a=(5,6)
b=(6,4)
if (a>b):print("a is bigger")
else: print("b is bigger")
Case1: Comparison starts with a first element of each tuple. In this case 5>1, so the outpu