Let's write a function that compares two lists to see if they are the same
def lists_equal(L1, L2):
'''Return True iff L1 and L2 have the same contents
Arguments:
L1, L2 -- lists of integers
'''
# Need to check whether the two lists are the same length first,
# since otherwise we'll get an out-of-range error in the for-loop
if len(L1) != len(L2):
return False
for i in range(len(L1)):
if L1[i] != L2[i]:
return False
return True