I'm blanking out trying to write a simple function to count the string length recursively.
I can do sums, fibonacci, and factorial easy but I'm trying to create the simplest function with only one parameter, I don't like having a second just as a counter index..
Can any post something small for me?
Is this what you are looking for?
def recursiveLength(theString):
if theString == '': return 0
return 1 + recursiveLength(theString[1:])