Hi, I'm working on this problem in my python programming class and need help with part of it. I need to have it display a "F" for anyones grade that is below 60, and also have it display the amount of "F" students, as well as the percentage of students who passed. My code correctly displays the points earned by each student but i can't figure out the rest.
The students and their corresponding grades are:
Johnson Smith: 93
Maryanne James: 80
Stanton Chase: 45
Mildred Morris: 90
George Deitz: 89
Maisie Kling: 79
My code is as follows:
def main():
file_students = open("student_points.txt" , "r")
stu_name = file_students.readline() #read the first record
#which is the first student's name
num_stu = 0
print("Student\t\t\tPoints\t\tGrade")
print("--------------------------------\n")
while stu_name != "":
stu_name = stu_name.rstrip("\n") #strip \n from name
stu_points = file_students.readline() #read points
stu_points = int(stu_points) #cast points into an int
print(stu_name, "\t\t", stu_points, sep="")
num_stu += 1
stu_name = file_students.readline()
file_students.close()
print()
print("Number of students processed =", num_stu)
main()
Thanks for any help