Program Console Vignaankosh.com
Execution Panel
Console is empty.
Create empty 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.
# Empty set - MUST use set()
empty_set = set() # empty_set=set()
print("Empty set:", empty_set) # empty_set=set()
print("Type:", type(empty_set)) # empty_set=set()
print(f"Length: {len(empty_set)}") # empty_set=set()
# WRONG way - this creates an empty dictionary
wrong = {} # wrong={}
print("\nWrong way {}:", wrong) # wrong={}
print("Type of {}:", type(wrong)) # wrong={}
# Check if set is empty
if not empty_set: # empty_set=set()
print("\nSet is empty!")
# Add elements to empty set
empty_set.add(10) # empty_set={10}
empty_set.add(20) # empty_set={10, 20}
print(f"\nAfter adding: {empty_set}") # empty_set={10, 20}