LearnPy Hub
← Loops problems
Easy

Count a Letter With a Loop

Read a word and a letter. Count how many times the letter appears using a for loop over the word.

Input

Two lines.

Output

One integer.

Sample 1

Input
banana
a
Output
3

Sample 2

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