Activity 01
Code Prediction Challenge: Scope Hunt
Provide printed code snippets with local and global variables. Students predict outputs in pairs, discuss access rules, then test in Python IDLE. Debrief as a class on surprises.
Differentiate between local and global variables in terms of their accessibility.
Facilitation TipDuring Scope Hunt, circulate and ask pairs to explain their predicted outputs step-by-step to uncover hidden assumptions about variable lifetime.
What to look forPresent students with 2-3 short Python code snippets involving both local and global variables. Ask them to write down the predicted output for each snippet and briefly explain their reasoning, focusing on variable accessibility.