# L-16 MCS 275 Wed 20 Feb 2008 : recstrlen.py

# Give a recursive definition of a Python
# function (call it strlen) to determine the 
# length of a string given on input.
# The function returns the number of 
# characters in the string.

def strlen(s):
   """
   recursive length of a string
   """
   if s == '':
      return 0
   else:
      return 1 + strlen(s[1:len(s)])

def main():
   "test on strlen()"
   s = raw_input("give string : ")
   print strlen(s), len(s)

main()
