Reading document lines to the user (python)
<p>I'm trying to write a program to read 5 lines of a text document to the user, but I can't manage to get it to work. It currently prints line 4 and line 5 along with the "\n" (new line) by each of them. This is the code: </p>

<pre><code>filename = 'text_file_example.txt'
myfile = open(filename,'r')
myfile.readlines(5)
print(myfile.readlines(5))
myfile.close()
</code></pre>

<p>Would it be better to read one line in a for(range 5) loop?</p>
