Program Console Vignaankosh.com
Execution Panel
Console is empty.
Find common students in two classes (Intersection) 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 common students in two classes
class_a = {"Alice", "Bob", "Charlie", "David", "Eva"}
class_b = {"Charlie", "Eva", "Frank", "Grace", "Henry"}
print("Class A:", class_a)
print("Class B:", class_b)
# Students in both classes (Intersection)
common_students = class_a & class_b
print(f"\nStudents in both classes: {common_students}")
# Students only in Class A
only_a = class_a - class_b
print(f"Students only in Class A: {only_a}")
# Students only in Class B
only_b = class_b - class_a
print(f"Students only in Class B: {only_b}")
# All students (Union)
all_students = class_a | class_b
print(f"\nAll students: {all_students}")
print(f"Total unique students: {len(all_students)}")