def sortfunc(x_obj, y_obj):
 return cmp(y_obj[1], x_obj[1])

def sortfunc ( x_obj , y_obj ) : return cmp ( y_obj [ 1 ] , x_obj [ 1 ] )
a simple sort function to sort the values of a list using the second item of each item .