Question: PYTHON Help Homework: File IO Step 1. Create a text file that is a series of numbers. Have multiple lines of data, with multiple numbers
PYTHON Help
Homework: File IO
Step 1.
Create a text file that is a series of numbers. Have multiple lines of data, with multiple numbers on each line.
Example:
345 435 345 435 334 34 34
12 12 34 56 12 45
1 34.4 1 234.1 0 0 3
0 0 1 3 4 5 1 2
123
Step 2:
Write a program that reads each line of data and displays the sum of each line.
Details:
Your program should, in general, follow these steps:
1.Ask the user for a filename
2.Open that file
a.For each line in the file
i.Convert it to a list of numbers
ii.Sum all the numbers in the list
iii.Print the total and the average of those numbers
3.Close the file
Make sure it ignores lines that begin with "#" or that have a length of zero. If the file does not exist dont crash. Just tell the user that it doesnt exist.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
