Question: Check if there is a file created as expected ( and its content ) Sample Output File Created as below: table [ [ ,
Check if there is a file created as expected and its content
Sample Output File Created as below:
tablestudentRecord.txt
Reading Text Data from Text File: Use the data file created in Question :
Write a Python program named YourNameSIDLabpy with:
The function main which:
lets user input a file name eg "studentRecord.txt for opening the data file created from Question ; then
properly calls the readData function to read student records Name and Mark for programming course from the data file below.
Also write a function readData fname in the same program file, which:
accepts one argument of file name string, without return
reads students' records and determines the average mark
display students' records Student name and MarkSee sample program output
display the average with the decimal point for digit at the end.
Hint: may use function readlines to read all text file content as string list, or function read to read all text file content as one string, in readData
IMPORTANT: the file must be closed by close to disconnect both the program and the file.
Remark: File existence checking is needed in main to check the file in the storage medium
Sample Input File:
tablestudentRecord.txt
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
