title: Random Number File Writer
body: <p>Instructions:</p>
  
  <ul>
  <li>Write a program that writes a series of random numbers to a file.</li>
  <li>Each random number should be in the range of 1 through 100.</li>
  <li>The application should let the user specify how many random numbers the file will hold.</li>
  </ul>
  
  <p>Here's what I have:</p>
  
  <pre><code>import random
  
  afile = open("Random.txt", "w" )
  
  for line in afile:
      for i in range(input('How many random numbers?: ')):
           line = random.randint(1, 100)
           afile.write(line)
           print(line)
  
  afile.close()
  
  print("\nReading the file now." )
  afile = open("Random.txt", "r")
  print(afile.read())
  afile.close()
  </code></pre>
  
  <p>A few problems:</p>
  
  <ol>
  <li><p>It's not writing the random numbers in the file based on the range the user is setting.</p></li>
  <li><p>The file can't close once opened.</p></li>
  <li><p>When the file is read, nothing.</p></li>
  </ol>
  
  <p>While I thought the set up was okay, it seem to always get stuck on execution.</p>