Activity 01
Pair Programming: Pickle Student Records
Pairs create a dictionary of student names and marks, use pickle.dump() to save it to a file, then load and print it. They modify the dictionary, resave, and verify changes persist. Extend by adding error handling for missing files.
Differentiate between text and binary file handling in Python.
Facilitation TipDuring Pair Programming, give each pair a different custom object to pickle so they can discuss why some objects work while others raise errors.
What to look forPresent students with two code snippets: one using `pickle` to save a list of dictionaries, and another saving the same data as a JSON string. Ask them to identify which file is binary and explain why, based on the output or file size difference.