The Gruffalo

This challenge is inspired from Julia Donaldson and Alex Sheffler’s children book: “The Gruffalo”.

In this story a little mouse describes a ferocious animal/monster called a “Gruffalo” to scare other dangerous animals (fox, snake, owl) she encounters while taking a walk in the forest.

This little mouse being very imaginative she uses plenty of frightening adjectives to describe this fictional animal.

In this challenge you are going to write a program that generates a description of a Gruffalo. Each time the program is run, a new description will be generated.

Learning Objectives:


By investigating this challenge you are going to further improve your skills at:

  • Using lists and accessing values of a list randomly,
  • Concatenating strings together to create a longer string.

Remember, in Python, a list is a collection of values. It uses [square brackets].
For instance:

To access a random value from this list, you can use the random.choice method.

For instance:

Challenge


Complete the code below to describe your gruffalo further:

  • Has he got terrible teeth in his terrible jaws?
  • Has he got a poisonous wart at the end of his nose?
  • Has he got a black tongue and purple prickles all over his back?

Each time you run this code it will create a new description!

Share Button
Posted in Computer Science, Python - Beginner, Python Challenges Tagged with: ,

Our Latest Book

Follow this blog