What I have coded
students = ['Rose', 'Dorothy', 'Sophia', 'Blanch']
for i in range(len(students)):
print('Hey',students[i],',please input the folowing grades:')
weightAvg = []
discussionGrade = int(input('What was your discussion grade?: ')) # prompt grade 1
quizGrade = int(input('What was your quiz grade?: ')) # prompt grade 2
programGrade = int(input('What was your programming assignment grade?: ')) #prompt grade 3
weightAvg.append (discussionGrade*0.20 + quizGrade*0.30 + programGrade*0.50) #calculate weighted average
print('Your weighted grade point average is: ',weightAvg, '\n')`
The Output so far
Hey Rose ,please input the folowing grades:
What was your discussion grade?: 78
What was your quiz grade?: 88
What was your programming assignment grade?: 98
Your weighted grade point average is: [91.0]
Hey Dorothy ,please input the folowing grades:
What was your discussion grade?: 45
What was your quiz grade?: 99
What was your programming assignment grade?: 87
Your weighted grade point average is: [82.2]
Hey Sophia ,please input the folowing grades:
What was your discussion grade?: 67
What was your quiz grade?: 95
What was your programming assignment grade?: 77
Your weighted grade point average is: [80.4]
Hey Blanch ,please input the folowing grades:
What was your discussion grade?: 7
What was your quiz grade?: 45
What was your programming assignment grade?: 99
Your weighted grade point average is: [64.4]
My Question
Essentially I want this output
print("The best student is (student name) with a score of (highest average)")
I have placed my first block in a function and tried to return weightAvg but im still not outputing what I would like.
Any help and explanation would be fantastic! Thank you!