Count vowels recursively Dry Run in PYTHON

Count vowels recursively is an interactive PYTHON dry run visualizer from the Recursion programs section. Study the source code, then use the execution controls to follow each step, variable update, highlighted line, and console output.

This page provides a browser-based dry run with source-code highlighting, auto-scroll, voice narration controls, and execution output for learning the program step by step.

Count vowels recursively Program Code

def is_vowel(ch):
    return ch.lower() in 'aeiou'

def count_vowels(s):
    if not s:
        return 0
    count_rest = count_vowels(s[1:])
    return 1 + count_rest if is_vowel(s[0]) else count_rest

text = "Programming is Fun"
print(f"String: {text}")
print(f"Number of vowels: {count_vowels(text)}")

View the complete Recursion programs page.

Program Console Count vowels recursively Topic: PYTHON Vignaankosh.com
Execution Panel
Step 0/0
Console is empty.