Step 10 – extending your program
You should now have a program which asks a single riddle and gets a suitable answer. Good job! Now...
How could you improve your program? What else could you add to it?
Here are some ideas.
Idea 1 – different messages
You could give a different message to the user depending on how many guesses they took to answer correctly.
So, on one guess you could say "Wow, you got that quickly" or on three guesses something like "You got that by the skin of your teeth". Or something to fit the theme if the riddle.
This would use selection, perhaps using a set of if – else blocks.
Hint: an even better solution would use an idea called elif. You might want to look this up and see how it works.
Idea 2 – more riddles
What if there were a sequence of three riddles the user needed to answer? Getting more difficult? That might make a better program.
Maybe they get three lives each time. Or maybe just three lives overall? Or maybe five lives for the first riddle, three for the second and just one for the last?
You could reset the guesses variable at any time by using something like guesses = 3.
You'd need to make sure the riddles don't get too complex to begin with. It's important to keep your users interested in the program and to make them think they can win – even if you just want to make it fiendishly difficult...
Idea 3 – an escape room?
Maybe the program becomes an escape room rather than just a set of riddles? Or a "choose your own adventure" type of program?
If you're going to go down this route, I'd start with a totally blank program. You can copy and paste any parts of your riddle that you want to keep, but this is very much a different program.
I have a set of instructions for an escape room. I don't think they're brilliant, but they will give you lots of different ideas:
> click here to launch those instructions (opens in a new tab).
You can use a tool like Online Python to code at home. Or on the bus (google "Python online" – there are loads of tools out there). You just need to copy and paste your code into a text file to keep it saved.
Or you could talk to an adult and then download Python and install it one a computer at home. It should work pretty much as it does at school – but you MUST talk to to adult before you do this (I don't own your home computer and you could create problems by doing this!!).