Question: hackerrank.com / test / 7 h 5 i 7 skamti / questions / 2 ioa If the student's age is greater than 1 5 .
hackerrank.comtesthiskamtiquestionsioa
If the student's age is greater than the grade should be "High School",
Create another class School with the following attribute:
student list of type list.
containing Student objects
Implement the method for the School class. This method should take a list of Student objects as an argument and initialize the studentlist attribute with the provided list.
Create a method inside the School class called assigngrades. This method should call the calculategrade method for each student in the student ist and set their studentgrade attribute accordingly.
Define another method in the School class called getstudents bygrade. This method should take a string representing the grade le: si "Elementary", "Middle School": or "High School' as input and retum a list of student names tho belons to that grade. The search should be case insensitive.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
