(b) File reading: The code below attempts to read a file called TAs.txt that contains TA...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
(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) (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)
Expert Answer:
Answer rating: 100% (QA)
The code provided in the image contains several mistakes and Student X is supposed to identify and c... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
1. Stella Scott has a work-study position at the fitness center on campus. Her manager has asked her to create a worksheet to keep track of attendance and revenue for the fitness center's classes....
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1-5. Ivan's grandfather died and left a portfolio of municipal bonds. In 2012, they pay Ivan...
-
Q No. 1) a) Construct the Histogram for the following frequency distribution relating to the ages of telephone operators. Age (Years) No. of Operators 10-15 15-20 20-25 25-30 30--35 10 22 17 b)...
-
Refer to the Dawson Communications situation in Starters 5-13 and 5-15. Compute the gross margin percentage and rate of inventory turnover for 2017. One year earlier, at December 31, 2016, Dawson's...
-
A fleet owner finds, from his past records, that the cost per year of running a vehicle, whose purchase price is Rs 50,000, is: Thereafter, the running cost increases by Rs 2,000, but the resale...
-
A 6061-T6 aluminum alloy solid circular rod of length \(4 \mathrm{~m}\) is pinned at both of its ends. If it is subjected to an axial load of \(15 \mathrm{kN}\) and F.S. \(=2\) against buckling,...
-
Part A Adria Lopez of Success Systems is evaluating her inventory to determine whether it must be adjusted based on lower of cost or market rules. Her company has three different types of software in...
-
As part of her year-end responsibilities, Sharon prepared the company's variable costing income statement as follows. Sales Variable expenses: $418,700 COGS $142,200 Operating expenses 23,700 165,900...
-
Wolsey Industries Inc. expects to maintain the same inventories at the end of 20Y3 as at the beginning of the year. The total of all production costs for the year is therefore assumed to be equal to...
-
Two point charges are located on the x-axis of a coordinate system. Load #1 is +3nC and is 40 centimeters (40 cm) to the right of the origin. Load #2 is -5nC and is 20 centimeters (20 cm) to the left...
-
a. Suppose that a disk drive has 10,000 cylinders, numbered 0 to 9999. The driver is currently serving a request at cylinder 1400. The queue of pending requests is, in the order received: 100, 1200,...
-
Franziska and Safua play the game Halvsies. The game is set up with one pile of 5 stones, one pile of 8 stones, and one pile of 11 stones. Franziska, who's younger than Safua, always goes first. On...
-
Consider an interprocess-communication that uses mailboxes: // send msg to Process Id, TOID mailbox: receive (FromID, msg) // receive msg from process id, FromID mailbox: send (TOID, msg) Is it...
-
The frequency distribution shows the average number of pupils per teacher in some states of the United States. Find the variance and standard deviation for the data. Round your answers to one decimal...
-
1. Write an LMC (Little Man Computer) program to do the following task. if (value == 0) { } some_statements; next_statement;
-
LAB 7 TRAJECTORY PLANNING OBJECTIVE Emulate the movement of a robotic device from calculated results using forward kinematics Estimate the position of individual joints from the calculated results...
-
For each of the following reactions, express the equilibrium constant: a) H20 (I) H2 (g) + 02 (g) Ke = 1.0x107 b) Fe2 (g) 2F (g) Ke= 4.9 x 10-21 c) C (s) + O2 (g) d) H2 (g) + C2H4 (g) C2H6 (g) Ke =...
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1-6. On December 12, Irene purchased the building where her store is located. She paid...
-
Jenny earns $34,500 in 2012. Calculate the FICA tax that must be paid by: Jenny: ..............................Soc,Sec. ..................$______________...
-
The following additional information is available for the Dr. Ivan and Irene Incisor family. The Incisors own a rental beach house in Hawaii. The beach house was rented for the full year during 2012...
-
The spectral density of a random signal is given by \[S(f)= \begin{cases}0.0001 \mathrm{~m}^{2} / \text { cycle } / \mathrm{s}, & 10 \mathrm{~Hz} \leq f \leq 1000 \mathrm{~Hz} \\ 0, & \text {...
-
Fill in the Blank. Univariate distributions describe the probability distributions of __________ random variables.
-
What is a marginal density function?
Study smarter with the SolutionInn App