You are viewing a single comment's thread. Return to all comments →
Python solution
class Student(Person): def __init__(self, firstName, lastName, idNumber, scores): super().__init__(firstName, lastName, idNumber) self.scores = [] def calculate(self): prom = sum(scores) / len(scores) if prom >= 90: return 'O' elif prom >= 80: return 'E' elif prom >= 70: return 'A' elif prom >= 55: return 'P' elif prom >= 40: return 'D' else: return 'T'
Seems like cookies are disabled on this browser, please enable them to open this website
Day 12: Inheritance
You are viewing a single comment's thread. Return to all comments →
Python solution