Count unique vowels in a string Dry Run in PYTHON

Count unique vowels in a string is an interactive PYTHON dry run visualizer from the Sets 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 unique vowels in a string Program Code

# Count unique vowels in a string
text = "Hello World Programming is Amazing"
print("String:", text)

vowels = set('aeiouAEIOU')
unique_vowels = set()

for char in text:
    if char in vowels:
        unique_vowels.add(char.lower())

print(f"Unique vowels found: {unique_vowels}")
print(f"Count of unique vowels: {len(unique_vowels)}")

# One-liner using set comprehension
unique_vowels_comp = {char.lower() for char in text if char.lower() in 'aeiou'}
print(f"\nUsing comprehension: {unique_vowels_comp}")

View the complete Sets programs page.

Program Console Count unique vowels in a string Topic: PYTHON Vignaankosh.com
Execution Panel
Step 0/0
Console is empty.