Activity 01
Pair Programming: Age Validator
Pairs write a program that prompts for age, checks if it's a positive integer between 0 and 150, and reprompts if invalid. Add custom error messages. Test with 10 sample inputs and log results.
Explain why programs need to check user input for validity.
Facilitation TipDuring Pair Programming, have students switch roles every 5 minutes to keep both engaged in writing and testing the validator.
What to look forProvide students with three scenarios: entering text into an age field, entering a 10-digit number into a phone number field, and entering an email address. Ask them to write one sentence for each scenario explaining why the input might be invalid and one line of Python code to check for a common invalid case.