Skip to content

Instantly share code, notes, and snippets.

@tuannvm
Created January 15, 2017 09:03
Show Gist options
  • Save tuannvm/18e6c8cfec4d1d38f2b7564759b1ab6e to your computer and use it in GitHub Desktop.
Save tuannvm/18e6c8cfec4d1d38f2b7564759b1ab6e to your computer and use it in GitHub Desktop.
class Student():
def __init__(self, name, school):
self.name = name
self.school = school
self.mark = []
def average(self):
return sum(self.mark) / len(self.mark)
def friend(self, friend_name):
return Student(friend_name, self.school)
class WorkingStudent(Student):
### ERROR HERE: 14,4,error,E1002:Use of super on an old style class
def __init__(self, name, school, salary):
super().__init__(name, school)
self.salary = salary
anna = WorkingStudent('Anna', 'MIT', 20.00)
print(anna.salary)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment