demo_inheritance_child.py:
class Person: def __init__(self, fname, lname): self.firstname = fname self.lastname = lname def printname(self): print(self.firstname, self.lastname) class Student(Person): pass x = Student("Mike", "Olsen") x.printname()
➜ begtut>python demo_inheritance_child.py
Mike Olsen