title: Python - looking for a way to make this more efficient
body: <p>I'm relatively new to python and I'm looking for a way to make this code more efficient. Thank you!</p>
  <pre><code>import random
  import string
  import time
  ques = []
  anss = []
  nums = string.digits
  
  def que():
     for i in range(10):
         num0 = random.choice(nums)
         num1 = random.choice(nums)
         ans = num0 + '+' + num1
         ques.append(ans)
         ans = int(num0) + int(num1)
         anss.append(ans)
  
         global length
         length = len(ques)
  
  def main():
     
     global counter
     counter = 0
     for i in range(10):
         global answer
         answer = int(input('What is ' + ques[i] + '?\n&gt;&gt;'))
         if answer == anss[i]:
             print('Correct!')
             counter += 1
         else:
             print('Wrong!')
  
  def score():
     x = str((counter / length*100))
     x = 'You got ' + x + '%'
     return x
  
  
  if __name__ == '__main__':
     que()
     main()
     time.sleep(0.5)
     print('Please wait while we calculate your score.')
     time.sleep(1)
     print(score())
  
  </code></pre>
  <p>Before, I tried just having the answers and questions in a single list - but after one loop it'd add one to the index something like this.</p>
  <pre><code>for i in range(10):
     if answer == questions[i+1]:
         print('correct')
         i += 1 #This is meant to skip the answer part of the list and goto the next question but i couldnt get it to work.
   
  </code></pre>