This function compares the values of two arguments and x:
y
cmp(x,y)
The return value is:
A negative number if is less than x.
y
Zero if is
equal to x.
y
A positive number if is greater than x.
y
The built-in cmp() function will typically
return only the values -1, 0, or 1. However, there are other
places that expect functions with the same calling sequence,
and those functions may return other values. It is best to
observe only the sign of the result.
>>> cmp(2,5)
-1
>>> cmp(5,5)
0
>>> cmp(5,2)
1
>>> cmp('aardvark', 'aardwolf')
-1