LearnPy Hub
← Strings problems
Medium

Count a Pattern

Read a text and a pattern. Print how many times the pattern appears using count() (non-overlapping).

Input

Two lines.

Output

One integer.

Sample 1

Input
banana
an
Output
2

Sample 2

Input
aaaa
aa
Output
2
solution.py
Output appears here
Count a Pattern · Python practice problem · LearnPy Hub