How can we find the name of the student with highest percentage( in 4 subjects) using a dictionary? We have to calculate the percentage also.
n = int(input())
student_marks = {}
for _ in range(n):
name, *line = input().split()
scores = list(map(float, line))
student_marks[name] = scores
total_marks = sum(student_marks[name])
average_marks = total_marks/4
print(average_marks)
With this code I can get the percentage of each student but how to get the name of the student with maximum percentage?