Sep-25-2020, 07:04 AM
So, guys, i'm having a problem with my code. What i need to do is take grades of n students and put on a list, and take their grades e put on otherlist what i did, but, i'm not getting print the names of the students if more than one get the highest grade. My code until now:
student = []
grade = []
maxStudents =[]
while len(student) < 5:
student.append(input('Write de student name'))
grade.append(int(input('Write the student grade')))
for i in grade:
if i == max(grade,key=int):
maxStudents.append(student[grade.index(i)])
print(maxStudents)
