title: In python, using tkinter, my random numbers only generate once?
body: <p>Basically, I have this code:</p>
  
  <pre><code>from tkinter import *
  from tkinter import messagebox
  import random
  import string
  from tkinter import filedialog
  
  ktwoWin = Tk() #window
  qLabel = StringVar()
  userAnswer = StringVar()
  ktwoWin.withdraw() #hide the ktwoWin window
  pass
  
  num1= random.randint(1, 12) #random numbers
  num2= random.randint(1, 12)
  Answer= num1 * num2
  
  def ktwoOpen():
      ktwoWin.deiconify() #show the ktwoWin window
  
      ktwoWin.title("Kindergarten to Grade Two")
      ktwoWin.geometry("400x300")
      ktwoWin.grid()
  
      askbutton= Button(ktwoWin, text="ask me a question!", command = askquestion, height=3, width=16, bg="blue")
      askbutton.grid(column= 0, row= 0)
  
      submitbtn= Button(ktwoWin, text="Submit Answer", command=checkanswer, height=3, width=12, bg= "red")
      submitbtn.grid(column=1, row=0)
  
      q=Label(ktwoWin,textvariable=qLabel)
      q.grid(column=1, row=1)
      q.config(text="text to go here")
      qLabel.set("some text")
      answerentry= Entry(ktwoWin, textvariable=userAnswer)
      answerentry.grid(column=3, row=3)
      pass
  
  def askquestion():
      qLabel.set("what is" +str(num1) + "x" + str(num2) + "?")
  
  def checkanswer():
      useranswer=userAnswer.get()
      if int(useranswer) != Answer:
          messagebox.showwarning(message="the answer is " + str(Answer))
      else:
          messagebox.showinfo(message="correct!")
  
  ktwoWin.mainloop
  </code></pre>
  
  <p>Which, when I run the program, the random numbers I have, will only randomise once, if that makes sense? My question, ultimately, is there a way for me to loop the random number part of the code?
  any help is appreciated, thanks:)</p>