Question: 1 4 . 2 . 2 : Produce a program that reads a text file containing exam grades, and prints the highest exam grade. Rearrange

14.2.2: Produce a program that reads a text file containing exam grades, and prints the highest exam grade.
Rearrange the following lines to produce a program that reads a text file containing exam grades, stored one per line, and prints
the highest exam grade.
How to use this tool
Unused
maxGrade = grade
print("Highest grade =", maxGrade)
infile = open("grades.txt","r")
for line in infile :
grade = int(line)
maxGrade =0
if grade > maxGrade :
Tester.py v
Load default template...
infile.close()
 14.2.2: Produce a program that reads a text file containing exam

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!