CJCoding With Joseph
15free / daySign inCreate account
← Back to Question List

Select topics to narrow your question pool, then enable Random to jump to a random question matching your filters.

Topics:
Python Quiz #36

Calling The Parent Constructor

mediumClasses

What does the super().__init__(name, grades) line do inside HonourStudent?

📄 Code

1class Student:
2 def __init__(self, name: str, grades: list[float]) -> None:
3 self.name = name
4 self.grades = grades
5 
6 
7class HonourStudent(Student):
8 def __init__(self, name: str, grades: list[float], award: str) -> None:
9 super().__init__(name, grades)
10 self.award = award
11 
12 
13maya = HonourStudent("Maya", [88, 92, 75], "Gold")
14print(maya.name, maya.award)