Student Report Card

Python for AIMedium+10 XP+10

Student Report Card

A Student has a name and a list of marks. Add three methods:

  • average() returns the mean mark, rounded to 1 decimal place. With no marks, return 0.0.
  • passed(pass_mark=50) returns True when the average is at least pass_mark.
  • best() returns the highest mark. With no marks, return None.

Examples

Student('Zia', [60, 75]).average()
returns 67.5
Student('Zia', [60, 75]).passed(70)
returns False
Student('Zia', [60, 75]).best()
returns 75
Student("Ana", [70, 85, 90]).average()
returns 81.7
Student("Ben", [40, 55]).passed()
returns False

Hints

Solve it to unlock the solution

Once your code passes every test, a reference solution shows up here so you can compare it with yours.

solution.py
CtrlEnterto run