Activity 01
Pair Programming: Contact Book Creator
Pairs start with an empty dictionary and add five contacts as name:phone pairs. They write functions to retrieve, update, and display all entries. Pairs test each other's code and time lookups against a list version.
Compare the advantages of using a dictionary over a list for storing student records.
Facilitation TipDuring Pair Programming: Contact Book Creator, circulate and watch for students using list-style access like contacts[0] instead of contacts['name'], then prompt them to rewrite with proper keys.
What to look forPresent students with a Python code snippet that attempts to access a non-existent key in a dictionary. Ask: 'What error will this code produce, and why? How could you modify the code to handle this situation gracefully?'