Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python class Student: def __init__(self, name, id_num, quizzes, exams): self._name = name self._id_num = id_num self._quizzes = quizzes self._exams = exams def grade(self): average_quiz_score =

Python

image text in transcribed

class Student: def __init__(self, name, id_num, quizzes, exams): self._name = name self._id_num = id_num self._quizzes = quizzes self._exams = exams   def grade(self): average_quiz_score = sum(self._quizzes) / len(self._quizzes) average_exam_score = sum(self._exams) / len(self._exams) course_grade = 0.25 * average_quiz_score + 0.75 * average_exam_score return course_grade 
def find_best(students): return None 

if __name__ == '__main__': 
 s1 = Student('Jane Smith', 110837363, [90, 88, 82, 99], [80, 77]) s2 = Student('Mike Jones', 110284928, [78, 91, 50], [100, 91, 92]) s3 = Student('Abe Lincoln', 110293822, [88], [94, 78, 84, 91]) s4 = Student('Felix D. Cat', 110728365, [38, 88, 91, 77, 81], [95]) s5 = Student('Alan Turing', 110101100, [92, 99], [90, 90, 90]) 
 print('Testing find_best() for [s1, s2, s3, s4, s5]: ' + str(find_best([s1, s2, s3, s4, s5]))) print('Testing find_best() for [s2, s3, s5]: ' + str(find_best([s2, s3, s5]))) print('Testing find_best() for [s1, s3]: ' + str(find_best([s1, s3]))) 
Write a function find best that takes a list of Student objects and returns a list of the names of all students who scored 90 or higher on all of their exams. If no student scored 90 or higher on all of their exams, the function returns an empty list. Examples: Return Value Function Call find-best s1, s2, S3, S4, s5]) ['Mike Jones', 'Felix D. Cat', 'Alan Turing' find-best ([S2, s 3, S51) Mike Jones', 'Alan Turing' find-best [s 1, s 31)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Principles Of Database Systems With Internet And Java Applications

Authors: Greg Riccardi

1st Edition

020161247X, 978-0201612479

More Books

Students also viewed these Databases questions