-1
def gpa(grades):
total = 0
if grades == 'A':
total += 4
if grades == 'B':
total += 3
if grades == 'C':
total += 2
if grades == 'D':
total += 1
if grades == 'F':
total += 0
for x in grades:
return points = sum(points)/len(grade)
你需要展示它是如何不工作。將錯誤消息或錯誤的輸出複製到您的問題中。 –