I have executed following tuple cmp(), but unable to understand the cmp algorithm
a) When both tuple are equal , same data type , same value
>>> t=(1,2)
>>> t1=(1,2)
>>> print cmp(t,t1)
0
b) when 2nd value is bigger
>>> t=(1,2)
>>> t1=(2,2)
>>> print cmp(t,t1)
-1
c) and so on ....
>>> t=(1,2)
>>> t1=('a',2)
>>> print cmp(t,t1)
-1
>>> t=(1,2)
>>> t1=('a',2)
>>> print cmp(t1,t)
1
>>> t=(1,2)
>>> t1=(1,2,3)
>>> print cmp(t,t1)
-1