Activity 01
Pair Programming: Number Guessing Game
Pairs write a while loop for a guessing game where the computer picks a number from 1-100 and prompts guesses until correct. Include hints like 'too high' or 'too low'. Test with 5-10 rounds and count attempts.
Differentiate between 'for' loops and 'while' loops and when to use each.
Facilitation TipDuring Pair Programming, circulate to ensure pairs print the loop variable inside the loop to visualize how the condition evolves.
What to look forProvide students with a short Python code snippet containing a 'while' loop. Ask them to: 1. Trace the execution and state the final output. 2. Identify the loop's condition and explain why it terminates (or why it might not).