To create a subclass with a constructor in Python, follow these steps:
main.py100 chars5 lines
main.py130 chars5 lines
super()
function inside the constructor of the child class.main.py125 chars5 lines
main.py56 chars2 lines
Note that the child class can access all attributes and methods from its parent class.
gistlibby LogSnag