student = int(input('Enter number of students: '))
while True:
scores = input(f'Enter {student} score(s): ').split()
if len(scores) >= student:
scores = scores[:student]
break
def student_grades(scores, grades):
if scores >= best - 10:
return 'A'
elif scores >= best - 20:
return 'B'
elif scores >= best - 30:
return 'C'
elif scores >= best - 40:
return 'D'
else:
return 'F'
scores = [int(score) for score in scores]
total_grades = [student_grades(score, max(scores)) for score in scores]
for i in range(len(student)):
print(f'Student {i+1} score is {scores[i]} and grade is {total_grades[i]}')