Variable Scope & Memory Visualizer

Code Execution

1. global_var = "Earth"
2.
3. def explore():
4. local_var = "Mars"
5. print(global_var)
6. print(local_var)
7.
8. explore()
9. print(global_var)
10. print(local_var)
Click 'Next' to start execution.

Terminal Output

> System Ready...

Memory Visualizer

Global Scope (Heap / Data)

Self-Assessment

1. Where are local variables typically stored during execution?

2. Will the program crash if you print a global variable inside a function?

Score: 0/2