title: Setting timer in Python
body: <p>Hey guys I'm doing a program in python. It's a calculation program which gives you two random number from 2 to 10, and then asks you for example how much is 2 * 4. </p>
  
  <p>And if your answer is correct it gives you a point. Now, I want that the program let's the user calculate for 20secs and when 20secs are over, it will show you how much points you have. </p>
  
  <p>My code so far -> </p>
  
  <pre><code>__author__ = 'Majky'
  import random
  import time
  
  a = random.randint(2, 10)
  b = random.randint(2, 10)
  print("How much is", a, "times", b)
  t = 0
  
  odg = int(input("Answer ?"))
  sec = 0
  
  while sec &lt; 20:
  
  if odg == a * b:
  print("Correct")
  t = +1
  print("Incorrect")
  
  print("Your points are", t)
  </code></pre>