Activity 01
Pair Debug: Type Mix-Up Challenges
Provide pairs with buggy code snippets mixing strings and numbers, like adding user age to a score. Students identify errors, apply int() or float() conversions, and test with sample inputs. Discuss fixes as a class.
Justify the necessity of explicit type conversion in certain programming scenarios.
Facilitation TipDuring Pair Debug: Type Mix-Up Challenges, ask each pair to write down the exact error message they receive when they forget to convert input() before arithmetic.
What to look forPresent students with snippets of Python code. Ask them to identify if type conversion is needed and what function (int(), float(), str()) would be appropriate. For example: 'age_str = input("Enter your age: ")' - Is conversion needed? What function?