Question: The method customLen(L) is a recursive method that finds the length of a list L. However, it does not work correctly. Please write why,

The method customLen(L) is a recursive method that finds the length of 

The method customLen(L) is a recursive method that finds the length of a list L. However, it does not work correctly. Please write why, and describe the fix. def customLen (L): if L == [] : else: return 1 return 1 + customLen (L[1:])

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The issue with the current implementation of the customLen function i... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!