Text Adventures
LEARNING OBJECTIVE
Recognise how a class
can be used to create
custom objects.
CLASSES
A custom object that
you can make that has
it’s own set of
attributes.
Animal
Class
Giraffe Horse Lion
TASK
Open and look at the
Animals.py example from
SharePoint.
Can you figure out what
some of the bits of code
are doing?
Underneath the classcreate a new ‘instance’ of an animal
and give it some attributes. You can choose any animal you
like.
TASK
Use the design sheet to
plan your own text
adventure then follow
the instructions to
create this in Python.
LEARNING OBJECTIVE
Recognise how a class
can be used to create
custom objects.

Python - Lesson 6