title: Selecting a random month (Generating a random integer between a set range)
body: <p>I am trying to generate a random integer between 1 and 12 to serve as the month selection.
  Code:</p>
  <pre><code>def randomMonthNumber(size=2, chars=string.digits):
      return ''.join(random.choice(chars) for i in range(size))
  
  
  monthnumber = randomMonthNumber()
  If monthnumber &gt; 12
      monthnumber
  
  print(monthnumber)
  </code></pre>
  <p>At the moment I've tried to code it so that if the random number selected in the function is greater than 12 it runs the function again (and will keep doing so until the integer is below 12) and stores it in <code>monthnumber</code> but I keep getting syntax error at the If statement.</p>
  <p>Any ideas?</p>
  <p>Thanks in advance.</p>