title: random is not defined in python
body: <p>I'm trying to produce a random integer <code>n</code>, and create a list of n random integers with values between 0 and 9.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>def randomNumbers(n):
      myList = []
      needMoreNumbers = True
      while (needMoreNumbers):
          randomNumber = int(random.random() * 10)
          myList.append(randomNumber)
          n = n -1
          if (n &lt; 1):
              needMoreNumbers = False
      return myList
  </code></pre>
  
  <p>When I run it, it says:</p>
  
  <pre><code>NameError: global name 'random' is not defined
  </code></pre>