Question: give me the python code please this is dealing with files Goal: Learn to read structured files line by line. Assignment: A file named units.txt

give me the python code please this is dealing with files
Goal: Learn to read structured files line by line.
Assignment: A file named units.txt records the contents of the containers in a logistic hub. Each line contains the
number of items, and each container section is separated from the next by a line with a dash. The following is an
example file:
Contents of units.txt
10
123
95
285
64
Write some code that creates a file named totals.txt in which each line is the sum of all the item counts per
container section. Continuing the above example, the following is the example result:
Contents of totals.txt
228
349
give me the python code please this is dealing

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!