Activity 01
Pair Programming: String Challenges
Pairs solve five tasks: slice initials from full names, concatenate words into acronyms, reverse strings with slicing, apply upper() to titles, and format sentences with f-strings. Partners alternate coding and explaining logic. Class shares one creative solution.
Analyze how string indexing and slicing can extract specific parts of text.
Facilitation TipDuring Pair Programming: String Challenges, circulate and ask pairs to explain their indexing logic aloud before running code to uncover off-by-one errors.
What to look forProvide students with the string 'Singapore is a city-state'. Ask them to write down the character at index 5, the substring from index 10 to 17, and the result of concatenating the string with ' - SG'.