Challenge 1: Length of a String
Given a string find its length using recursion.
We'll cover the following
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!
def recursiveLength(testVariable) :# Write your code herereturn None
Let’s have a look at the solution review of this problem.