<div>&nbsp;</div>
<div>I&#39;m trying to create a program that creates a file and write the number for each line.&nbsp; Here is what I have so far but can&#39;t seem to get the loop and write correct.</div>
<div>&nbsp;</div>
<div>Thanks in advance.</div>
<div>&nbsp;</div>
<p>print &quot;Creating txt file&quot;<br>tfile = open(&quot;25.txt&quot;, &quot;w&quot;)</p>
<p>for i in range(25):<br>&nbsp;&nbsp;&nbsp; x = int(1)<br>&nbsp;&nbsp;&nbsp; tfile.writelines(&quot;x\n&quot;)<br>&nbsp;&nbsp;&nbsp; x += 1</p>
<p>tfile.close()&nbsp;&nbsp; </p>
<div>&nbsp;</div>