- What do you think is the overall function of each script? - What outputs do you predict these will generate? (Draw or write the expected output). - What common words do you see across the scripts? What unique words (e.g., import, parse, strip()) stand out? - **Task 1 (Annotate):** Write comments next to each line of code in the three scripts explaining what it does. - **Task 2 (Questioning):** Answer the following questions together: 1. What does the with keyword do? (Teacher note: Discuss how it safely opens and closes the file, preventing memory leaks). 2. In Script 2, what data type is row? (Hint: Look at how row[0] is used). 3. In Script 3, trace the use of tree, root, attrib, and .text. How does this relate to the hierarchy of an XML file ## MODIFY **Activity:** Edit the existing starter programs in small, increasingly challenging steps to add new functionality. - **Modify 1 (Basic):** Modify read_csv.py so that it skips the header row (Name, Score) when printing to the console. - **Modify 2 (Intermediate):** Modify read_txt.py to add new functionality. Change the 'r' (read) to 'a' (append). Add code to append your own name and a score of 99 to the bottom of the text file. Run it, then switch it back to 'r' to check if it worked. - **Modify 3 (Advanced):** Modify read_xml.py so that it only print()s the student's name if their score is greater than 50. (Requires converting the extracted string text into an integer). ## MAKE **The Brief:** "You have been asked by the school to migrate data. You are provided with a new, much larger file called vce_cohort.csv containing 50 students and their exam scores. Write a completely new Python script that: 1. Reads the data from vce_cohort.csv. 2. Identifies students who scored above 80. 3. Writes only those high-scoring students into a brand new file called high_achievers.xml.