I need help turning this while loop into a recursive method? How do I do this?

```
while z <= len(list):
     if z = len(list): #base case
        return something
     else:
        #do something else
     z += 1

```