Output
Variable Name      Object in Memory
number1
number2
answer
temp
  1  import random
  2  
  3  # 1. Generate two random single-digit integers
  4  number1 = random.randint(0, 9)
  5  number2 = random.randint(0, 9)
  6  
  7  # 2. If number1 < number2, swap number1 with number2
  8  if number1 < number2:
  9      number1, number2 = number2, number1
 10  
 11  # 3. Prompt the student to answer What is number1 - number2?
 12  answer = eval(input("What is " + str(number1) + " - "
 13      + str(number2) + "? ")) 
 14  
 15  # 5. Repeatedly ask the user the question until it is correct
 16  while number1 - number2 != answer:
 17      answer = eval(input("Wrong answer. Try again. What is "
 18          + str(number1) + " - " + str(number2) + "? ")) 
 19    
 20  print("You got it!")