Program Console Vignaankosh.com
Execution Panel
Console is empty.
Convert string to set (unique characters) 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.
# Convert string to set (unique characters)
text = "programming"
print("Original string:", text)
# Convert to set of characters
char_set = set(text)
print("Set of characters:", char_set)
print(f"Unique characters: {len(char_set)}")
# String with spaces and punctuation
sentence = "hello world"
sentence_set = set(sentence)
print(f"\nString: '{sentence}'")
print(f"Set: {sentence_set}")
# Convert and sort
sorted_chars = sorted(set(text))
print(f"\nSorted unique characters: {sorted_chars}")
# Case-sensitive example
case_text = "Python PYTHON"
case_set = set(case_text)
print(f"\nCase-sensitive set: {case_set}")