Activity 01
Pair Prediction Challenge: Scope Shadows
Pairs write a Python function that modifies a variable with the same name as a global one. They predict printed outputs on paper first, then code and run to compare. Discuss differences and rewrite using parameters.
Explain the difference between local and global variables in a Python program.
Facilitation TipDuring Pair Prediction Challenge, circulate and ask each pair to explain their prediction reasoning before running the code together.
What to look forPresent students with a short Python code snippet containing both local and global variables, some with identical names. Ask them to write down the predicted output and circle the variables they identify as global and underline those they identify as local.