Use recursion to write a Python function depth(LL), where LL is a nested list of lists of lists etc. of numbers (i.e., oat and int) and strings. We want to return the depth of nesting, i.e., how often, maximally, there is a list in a list etc. in LL. You may use the function type(..).
Examples for testing: Single integers, oats and strings have depth 0. In ['a',9] and in [ ] the depth of nesting is 1, since there is no list in a list. In [2,[1],1,[3,2],[5,-1,0.1],1] and in [[ ]] the depth is 2, since there is a list within the list (but no list in a list in a list). In [2,[1,-1,[3,2],[ ],3],1,4,['ab']] and in [[[ ],[ ]],[ ]] the depth is 3; there is a list in a list in a list. In [2,[2,[3],[1,[2]]],1,[2,2]] the depth is 4. Similarly, one could give examples of depth could be 5, 6, etc.
The following auxiliary function create a sample list:
def listsample():
L = []
for i in range(10):
L = L + [L[len(L)//2:]+[i,[i-1]]]
return L[:]
How do you use your depth function to nd the depth of this sample list? Give the calls and their output (as comments).