my code works fine when I don't have white spaces but I can't make it work when the string has.
I am trying sth like:
def lengthR(mystring): count=0 if mystring=='': return 0 while (mystring!='') and (' ' not in mystring): mystring=mystring[0:-1] lengthR(mystring) count+=1 return count
but it returns 0 if there is space in the string.
After the while statement I define a new string which is reduced by 1 character (but it is the last character , so I don't know what to do with white space)