Exercise 2: Write a Python program that reads from each line of an input file called grades.txt, a student id followed by the student grades in 3 exams. The program will then calculate the average of...


Exercise 2:<br>Write a Python program that reads from each line of an input file called grades.txt, a student id<br>followed by the student grades in 3 exams. The program will then calculate the average of the<br>student and save in a file called results.txt the student id followed by the calculated average. For<br>example, if the grades.txt contains<br>S111 60 60 90<br>S222 89.5 90 89<br>S333 42 50 43<br>The file results.txt will contain<br>S111: 70.00<br>S222: 89.50<br>S333: 45.00<br>

Extracted text: Exercise 2: Write a Python program that reads from each line of an input file called grades.txt, a student id followed by the student grades in 3 exams. The program will then calculate the average of the student and save in a file called results.txt the student id followed by the calculated average. For example, if the grades.txt contains S111 60 60 90 S222 89.5 90 89 S333 42 50 43 The file results.txt will contain S111: 70.00 S222: 89.50 S333: 45.00

Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here