list1, list2 = [123, 'xyz'], [456, 'abc'] print cmp(list1, list2) print cmp(list2, list1) print list3 = list2 + [789] print list3 print cmp(list2, list3)