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:
colourList = ["red","blue","yellow","green","magenta"]
To access a random value from this list, you can use the random.choice method.
For instance:
colourList = ["red","blue","yellow","green","magenta"] randomColour=random.choice(colourList)
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!
Solution...
The solution for this challenge is available to full members!Find out how to become a member:
➤ Members' Area