title: Python: Writing on a plain text file a really long list of consecutive numbers
body: <p>I'm trying to do a really long list of consecutive numbers starting from 0 and finishing in like 10,000,000,000 or more and write it to a plain text file. What I currently have uses all the RAM (12 GB) and makes my computer to reboot.</p>
  
  <pre><code>i = 0
  password = []
  
  file = open("pass.txt", "a")
  for i in range (10000):
      password.append("%016d" % (i,))
  
  for elem in password:
      file.write(str(elem) + '\n')
  
  file.close
  print("Finished")
  </code></pre>