Challenge 1: Length of a String

Given a string find its length using recursion.

Problem Statement

Implement a function that takes a string testVariable and returns the length of the string.

Try to solve this problem recursively.

Input

A variable testVariable that contains a string.

Output

Length of the input string.

Sample Input

"Educative"

Sample Output

9

Try it Yourself

Try to attempt this challenge by yourself before moving on to the solution. Good luck!

Press + to interact
def recursiveLength(testVariable) :
# Write your code here
return None

Let’s have a look at the solution review of this problem.