Times Table Tester

Step 4 – Getting an answer

Now we need to get an answer from the user and store it in a variable called answer.

Code helper image
  1. Add a line of code:   answer = input("Enter your answer")
  2. Run your code (Run > Run Module)

The program still doesn't do anything else, but we do know it's stored the answer in the variable called answer.

THEORY: answer is another variable. Remember, a variable is a named area of memory where we can store a value. We've already used the variables number1 and number2 to get the numbers for the question.