Values printed are different when debugging
<pre><code>cnt = 0
s = 'aghe'
s_len = len(s)
s_len = s_len - 1
while s_len &gt;= 0:
    if s[s_len] in ('aeiou'):
        cnt += 1
    s_len -= 1
    break;
print ('numofVowels:'),cnt  
</code></pre>

<p>This does print the value of <code>cnt</code>. When debugging, <code>cnt</code> has the correct value!</p>

<p>You will want to get rid of the <code>break</code>, and make sure to include <code>cnt</code> inside the parentheses for your <code>print</code> call (having it outside the parentheses will cause it not to print in Python 3):</p>

<pre><code>cnt = 0
s = 'aghe'
s_len = len(s)
s_len = s_len - 1

while s_len &gt;= 0:
    if s[s_len] in ('aeiou'):
        cnt += 1
    s_len -= 1
print('numofVowels:', cnt)
</code></pre>

<p>The <code>break</code> in your while loop will ensure that it only loops once, and then stops (<code>break</code>s), which is probably not what you want if you are trying to count all the vowels in a string. Also, if you must use <code>break</code> don't follow it with a semicolon <code>;</code>. This will not cause a syntax error in Python, but is not necessary in this case, and is used exclusively (AFAIK) for putting multiple statements on a single line in Python (e.g., <code>import pdb; pdb.set_trace()</code>), and even that usage is generally discouraged. </p>

python