Skip to content

mherkhachatryan/Students-marks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Students-marks

A Freelance Upwork work.

Assignment:

Write a Python program that reads the input from a text file and saves the output to another text file. Ensure that the code is well documented. Your name, date and purpos.the code must be commented well. Ensure that the comments are clear and grammatically correct. Please use try/except statement to catch errors/exceptions relating to file input/output, for example FileNotFoundError. Add a generic except to catch any error that may occur. I have provided you with a text file student_marks.txt, the file containing the input. The file has information about some students. This file can contain any number of lines/records. Each line/record has information regarding a student- the student number and his/her marks in assignments he/she has done during the semester. Note that the number of assignments done by a student can be 0 or more. Please note that a comma separates each piece of information. If a student has not done any assignment, then only the student number appears on the line/record. You are required to code a Python program that takes the input from student_marks.txt and creates an output file whose contents match the provided output file, student_results.txt. PLEASE NAME THE OUTPUT FILE AS your_name.txt, where your_name is your name. Each line/record of the output file has the student number and the total marks attained during the semester. The total marks are calculated by adding up all the assignment marks for the student. I need the sub-headings/labels Student Number and Total Marks sand the information is separated by a tab. Information of each student occurs on a separate line.