Activity 01
Pair Programming: CSV Grade Analyzer
Pairs read a CSV of student scores, compute class averages using lists, and write results to a summary text file. Start by importing csv and handling open errors with try-except. Test by swapping valid and invalid files, then discuss fixes.
Explain the importance of error handling when performing file input/output operations.
Facilitation TipDuring Pair Programming, assign clear roles: one driver writes code while the navigator checks syntax and anticipates errors.
What to look forProvide students with a small, pre-made CSV file. Ask them to write pseudocode or a short Python snippet that reads the file, calculates the average of a specific column, and prints the result. Include a prompt: 'What is one potential error that could occur, and how would you handle it?'