Step 4 – Getting an answer
Now we can ask a riddle, we need a way of getting the players to give us an answer.
We do this using a command called input.
![Code helper image](riddle1/r6code1.png)
- Underneath the code you already have ADD: print("What is your answer?)
- Run this now. You can see that it just prints like before
- Now, underneath type: input("> ")
Don't forget the quotes (") and brackets. And do you see that I added a space after the > symbol?
- Now run the program again. This time it waits for you to enter a name.
The > symbol is a classic way to show a player that they need to enter something.
Storing the answer
We're going to need to check that the answer is correct.
To store it we need to use a variable.
![Code helper image](riddle1/r6code2.png)
- Change the line of code with the input to: answer = input("> ")
- Now run the code
Make sure you CHANGE THE CODE. Don't just add this on the bottom.
It won't seem to make a difference, but the answer is stored somewhere in the computer.