LearnPy Hub
← Recursion & Lambda problems
Easy

Count a Letter Recursively

Write a recursive count(s, c) that returns how many times c appears in s (no loops, no .count). Read s and c and print the result.

Input

Two lines.

Output

One integer.

Sample 1

Input
banana
a
Output
3

Sample 2

Input
hello
z
Output
0
solution.py
Output appears here
Count a Letter Recursively · Python practice problem · LearnPy Hub