Trying to calculate highest marks with name in python
问题 grade=[] names=[] highest=0 cases=int(input('Enter number of cases: ')) for case in range(1,cases+1): print('case',case) number=int(input('Enter number of students: ')) for numbers in range (1,number+1): name=str(input('Enter name of student: ')) names.append(name) mark=float(input('Enter mark of student:')) grade.append(mark) print('Case',case,'result') print('name',list[list.index(max(grade))]) average=(sum(grade)/number) print('average',average) print('highest',max(grade)) print('name'