# Write code to count the number of syllables # in the string w using these rules: # - Treat y as a vowel # - If the first letter is a vowel increment by 1 # - For the remaining letters: # - If a letter is a vowel and the previous one is not, # count that as a syllable # - If the word ends with 'e', decrease the count if # the letter to its left is not a vowel # - Ensure that the count is at least 1. def count_syllables(w): count = 0 # Write your code here return count