The Student Module

A local high school needs a tool to help manage the academic records of its students. They have asked for a program that can calculate the average marks of a student and determine if the student has passed or failed. The passing mark is 50.
You are asked to develop a module that defines a Student class. Each student should have properties name, age, and marks (which is a list). The Student class should also include a method to calculate the average mark and another method to check if the student has passed or failed:
  • average_mark: this method should return the average mark of the student.
  • has_passed: this method should return True if the student's average mark is 50 or higher, and False otherwise.
The module will take care of input and output automatically.
student1 = Student("John", 16, [65, 80, 90]); print(student1.average_mark()); print(student1.has_passed())
78.33 True
Note: For the purpose of this challenge, you only need to develop the module, and do not need to worry about how the module will use it. Your module should correctly define the Student class and its methods so that they work as described above.


Time limit: 2.4 seconds

Memory limit: 512 MB

Output limit: 1 MB

To check your solution you need to sign in