Learntofish's Blog

A blog about math, physics and computer science

Posts Tagged ‘inheritance’

Python 3: Inheritance and super()

Posted by Ed on April 23, 2016

Inheritance in Object Oriented Programming (OOP) means that you create a new class by extending an existing class. For example, suppose we have a class Shape with the attribute position. Then we can create a new class Circle by taking Shape and extending it by a new attribute center: Read the rest of this entry »

Posted in computer science, programming | Tagged: , , | Leave a Comment »

Tutorial: Object Oriented Programming in Python – Part 5

Posted by Ed on December 10, 2011

This is the continuation of the Python OOP tutorial. Here, I will talk about inheritance. The general syntax is:

class DerivedClass(BaseClass)

Last time (in part 4) we wrote a Vehicle class that allowed us to create objects with Read the rest of this entry »

Posted in computer science | Tagged: , , , , , , , , , , , | 3 Comments »