Question: (b) File reading: The code below attempts to read a file called TAs.txt that contains TA names, followed by their class year (separated by
(b) File reading: The code below attempts to read a file called TAs.txt that contains TA names, followed by their class year (separated by a space). The goal is to create a list of TA names (i.e. name_1st = ['Ella', 'Grace', 'Henry', 'Trinity']). Here is the file: Ella 2025 Grace 2025 Henry 2024 Trinity 2024 Student X has attempted to complete this problem with the following code. Identify and correct at least 3 errors with this code. name_1st [0] f = open('TAs.txt', 'r') for line in range (f): line.split() name = line [0] name.append (name_1st)
Step by Step Solution
There are 3 Steps involved in it
The code provided in the image contains several mistakes and Student X is supposed to identify and c... View full answer
Get step-by-step solutions from verified subject matter experts
