title: Finding first vowel of a word in Python
body: <p>so I am having trouble finding the index of the first vowel of a inputted string. When putting in the string "elephant" , "hello" , "spa" they work properly, however when I input "spam" it does not work, it returned the number 3 instead of 2. I am having trouble finding why it satisfies the else statement but not the initial if condition. I am also trying to put a condition that if there are no vowels in the string, then it should print out the index of the last character in the string. Below is my code:</p>
  
  <pre><code>def find_first_vowel(word):
      i = 0   
      while i &lt; len(word):
          i+= 1
          if word[i] in vowels:
              return i
          else:
              return len(word)-1
      return i
  
  print(find_first_vowel("spam"))   
  </code></pre>