Contact FutureLearn for Support
Skip main navigation
We use cookies to give you a better experience, if that’s ok you can close this message and carry on browsing. For more info read our cookies policy.
We use cookies to give you a better experience. Carry on browsing if you're happy with this, or read our cookies policy for more information.

Skip to 0 minutes and 4 secondsIn week one, we used classes written by other people. And in week two, we wrote our own class from scratch. This week, we will extend the class to add our own functionality to the code that's already there. Extending a class takes advantage of a concept called inheritance. The new class will be said to inherent properties from its parent class, just like a child might inherit traits from its parents. We can extend the class by defining new attributes or methods or by changing the behaviour of existing methods. This week we will create the character to inhabit our game world.

Welcome to Week 3

In Week 1 we used classes written by other people, and in Week 2 we wrote our own class from scratch. This week we will extend a class by adding our own functionality to existing code.

Extending a class takes advantage of a concept called inheritance – the new class can be said to inherit properties from its parent class. To extend a class, we can define new attributes or methods, and also change the behaviour of existing methods.

This week we will be creating characters to inhabit our game world.

Share this video:

This video is from the free online course:

Object-oriented Programming in Python: Create Your Own Adventure Game

Raspberry Pi Foundation