+ 1
Compare function does not work, Why?
list1 = [1,2,3] list2 = [4,5,6] print (list1) print (list2) print (cmp(list1,list2)) Output: [1, 2, 3] [4, 5, 6] Traceback (most recent call last): File "python", line 5, in <module> NameError: name 'cmp' is not defined
4 Answers