def compare(lst1, lst2): if len(lst1) != len(lst2): return False elif(lst1[0] == lst2[0]): return compare(lst1[1:],lst2[1:]) Example output: >>>
Fantastic news! We've Found the answer you've been seeking!
Question:
def compare(lst1, lst2):
if len(lst1) != len(lst2):
return False
elif(lst1[0] == lst2[0]):
return compare(lst1[1:],lst2[1:])
Example output:
>>> compare(['ispython',2,3],['ispython',2,3])
True
>>> compare(['ispython',2,3],['ISpython',2,3])
False
>>> compare(['ispython',2,3],[1,2,3,4])
False
The error code Im getting tell me \"list index out of range\". Any help would be really valuable!
Posted Date: