← Back to challenges

Count Syllables

PythonMediumstringslanguage_fundamentals

Instructions

Create a function that counts the number of syllables a word has. Each syllable is separated with a dash -.

Examples

number_syllables("buf-fet") ➞ 2

number_syllables("beau-ti-ful") ➞ 3

number_syllables("mon-u-men-tal") ➞ 4

number_syllables("on-o-mat-o-poe-ia") ➞ 6
python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Age Difference Between Spouses