我需要爲每位獲得A,B,C,D和F的學生記錄一個計數。該項目的說明要求用戶輸入LETTER成績,而不是百分比分數。那麼我將如何跟蹤每封信呢?下面是我有:Python 3.保留字母等級
Grades = open("ClassNameGrades.txt", "w")
count = 0
A=0
B=0
C=0
D=0
F=0
Grades.write=input("Enter name of class - ",)
Grades.write= input("Enter name of faculty - ")
numStudents= int(float(input("Enter the amount of students - ")))
def gradeInput(count,numStudents,A1):
while count<numStudents:
studentName=input("Enter name of student - ")
Grades.write(studentName("\n"))
studentGrade=input("Enter student letter grade - ",)
Grades.write(studentGrade("\n"))
count+=count
運行此腳本會產生什麼結果?它不符合您的要求? – lit