title: Python times tables code with recursion
body: <p>I have to make a times table code using recursive functions. I have to ask the user for a number and print out the times tables from 1 to 12. And I have to use recursive functions and it is not allowed to use <code>for</code> loops or <code>while</code> loops and all variables besides the user input have to be defined inside the functions. I am having trouble defining the number that the user provided number needs to be multiplied with. E.X. 2 x <strong>1</strong> 2 x <strong>2</strong> 2 x <strong>3</strong>. </p>
  
  <pre><code>def times_tables(num):
      def multiply(x):
          product = x * num
      if x &lt; 12:
          print (str(multiply(x + 1)))
  
  user = input("Enter a number: ")
  times_tables(user)
  </code></pre>
  
  <p>If I define <code>x</code> in the <code>times_tables</code> function then every time the function runs it will get set back to whatever I set it to the first time. Thanks for your help. </p>