title: Find first vowel of a string only using if statements
body: <p>I need to find the first vowel in a string. My code passes a few cases but when it's tested for the 'asked' it fails because it returns position 3 instead of 0 since a is the first vowel. Also in the string does not contain vowels it should return the length of the string.</p>
  <p>The other thing I tried was: if 'a' in s then give me the position of a but that failed for the word 'eat'. I'm not sure how to proceed. I have pasted my code below:</p>
  <pre><code>import introcs
  
  def first_vowel(s):
      &quot;&quot;&quot;
      Returns the position of the first vowel in s; it returns len(s) if there are no vowels.
      
      We define the vowels to be the letters 'a','e','i','o', and 'u'.  The letter
      'y' counts as a vowel only if it is not the first letter in the string.
      
      Examples: 
          first_vowel('hat') returns 1
          first_vowel('grrm') returns 4
          first_vowel('sky') returns 2
          first_vowel('year') returns 1
      
      Parameter s: the string to search
      Precondition: s is a nonempty string with only lowercase letters
      &quot;&quot;&quot;
      result = len(s)
      c1 = introcs.count_str(s,'a')
      c2 = introcs.count_str(s,'e')
      c3 = introcs.count_str(s,'i')
      c4 = introcs.count_str(s,'o')
      c5 = introcs.count_str(s,'u')
      
      if (c1 or c2 or c3 or c4 or c5 )== -1:
          c1 == 0
          c2 == 0
          c3 == 0
          c4 == 0 
          c5 == 0
  
      sums = c1 + c2 + c3 + c4 + c5  
      
      if  0&lt;sums&lt;=1:
          pos_a = introcs.find_str(s,'a')
          result = pos_a
          
      if ('e' in s)  and (result == len(s)):
          pos_e = introcs.find_str(s,'e')
          result = pos_e
          
          
      return result
  </code></pre>