LearnPy Hub
← Recursion & Lambda problems
Easy

Length by Recursion

Write a recursive length(s) that returns the number of characters without using len(). Read a word and print it.

Input

One word.

Output

One integer.

Sample 1

Input
hello
Output
5

Sample 2

Input
a
Output
1
solution.py
Output appears here
Length by Recursion · Python practice problem · LearnPy Hub