# Grades3 Example # Source code file: grades3.py # Input file: grades.txt # Compute the maximum of all the grades. sum = 0 fin = open("grades.txt", "r") # Read and process first line from file line = fin.readline( ) grade = int(line.strip( )) maximum = grade # Process lines until end of file while line != "": grade = int(line.strip( )) maximum = max(maximum, grade) line = fin.readline( ) print("Maximum of grades:", maximum) fin.close( ) # Output: # Maximum of grades: 100