title: Syllable Count In Python
body: <p>I need to write a function that will read syllables in a word (for example, HAIRY is 2 syllables).  I have my code shown on the bottom and I'm confident it works in most cases, because it works with every other test I've done, but not with "HAIRY" where it only reads as 1 syllable.</p>
  
  <pre><code>def syllable_count(word):
      count = 0
      vowels = "aeiouy"
      if word[0] in vowels:
          count += 1
      for index in range(1, len(word)):
          if word[index] in vowels and word[index - 1] not in vowels:
              count += 1
              if word.endswith("e"):
                  count -= 1
      if count == 0:
          count += 1
      return count
  </code></pre>
  
  <hr>
  
  <p>TEST   </p>
  
  <pre><code>print(syllable_count("HAIRY"))
  </code></pre>
  
  <p>Expected: 2</p>
  
  <p>Received: 1</p>