lab 2 3

mail@pastecode.io avatar
unknown
python
a year ago
710 B
2
Indexable
Never
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]}')