Question: Write in python, syllable_count This function takes a word and returns the number of syllables in the word. For this exercise, assume that syllables are
Write in python,
syllable_count
This function takes a word and returns the number of syllables in the word. For this exercise, assume that syllables are determined as follows: Each sequence of vowels a e i o u y, except for the last e in a word, is a vowel. However, if that algorithm yields a count of 0, change it to 1. For example,
| Word | Syllables |
|---|---|
| Harry | 2 |
| hairy | 2 |
| hare | 1 |
| the 1
def syllable_count(word): """ Returns the number of syllables in the word. For this exercise, assume that syllables are determined as follows: Each sequence of vowels a e i o u y, except for the last e in a word, is a vowel. However, if that algorithm yields a count of 0, change it to 1. :param word: the word whose syllables are being counted. >>> syllable_count('Harry') 2 >>> syllable_count('HAIRY') 2 >>> syllable_count('hare') 1 >>> syllable_count('the') 1 """ # replace pass below with your code pass |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
