Program Console Vignaankosh.com
Execution Panel
Console is empty.
Find unique words in a sentence using set 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.
# Find unique words in a sentence
sentence = "the quick brown fox jumps over the lazy dog the quick brown fox"
print("Sentence:", sentence)
# Split into words and convert to set
words = sentence.split()
unique_words = set(words)
print(f"\nTotal words: {len(words)}")
print(f"Unique words: {len(unique_words)}")
print(f"Unique words: {unique_words}")
# Case-insensitive unique words
sentence2 = "Python python PYTHON is fun Fun FUN"
words_lower = sentence2.lower().split()
unique_lower = set(words_lower)
print(f"\nCase-insensitive unique: {unique_lower}")