by the student grades in 3 exams. The program will then calculate the average of the student a file called results.txt the student id followed by the calculated average. For example, if th contains si11 60 60 90 5222 89.5 90 89 5333 42 50 43 The file results.txt will contain $111: 70.00 $222: 89.50 5333: 45.00
by the student grades in 3 exams. The program will then calculate the average of the student a file called results.txt the student id followed by the calculated average. For example, if th contains si11 60 60 90 5222 89.5 90 89 5333 42 50 43 The file results.txt will contain $111: 70.00 $222: 89.50 5333: 45.00
Chapter13: File Input And Output
Section: Chapter Questions
Problem 6PE
Related questions
Question
![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
sii1 60 60 90
S222 89.5 90 89
S333 42 50 43
The file results.txt will contain
si11: 70.00
S222: 89.50
S333: 45.00](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fbc79f0bb-b49c-4077-90cd-bed0cd7aaad3%2F0ecf2dce-b83f-4344-831d-ab55be8cb560%2Fmparup4_processed.jpeg&w=3840&q=75)
Transcribed Image Text: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
sii1 60 60 90
S222 89.5 90 89
S333 42 50 43
The file results.txt will contain
si11: 70.00
S222: 89.50
S333: 45.00
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps with 3 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781337671385/9781337671385_smallCoverImage.jpg)
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
![C++ Programming: From Problem Analysis to Program…](https://www.bartleby.com/isbn_cover_images/9781337102087/9781337102087_smallCoverImage.gif)
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781337671385/9781337671385_smallCoverImage.jpg)
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
![C++ Programming: From Problem Analysis to Program…](https://www.bartleby.com/isbn_cover_images/9781337102087/9781337102087_smallCoverImage.gif)
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning