Riddle me this – it's all Greek to me

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
  1. Underneath the code you already have ADD:  print("What is your answer?)
  2. Run this now. You can see that it just prints like before
  3. Now, underneath type:  input("> ")

    Don't forget the quotes (") and brackets. And do you see that I added a space after the > symbol?

  4. 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
  1. Change the line of code with the input to:  answer = input("> ")
  2. 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.