← Back to challenges

Find the Amount of Potatoes

PythonMediumstringslanguage_fundamentalsregex

Instructions

Create a function to return the amount of potatoes there are in a string.

Examples

potatoes("potato") ➞ 1

potatoes("potatopotato") ➞ 2

potatoes("potatoapple") ➞ 1

Notes

N/A

python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Slice of Pie