title: Python Loop Only Parses First Five Lines of Text File
body: <p>I'm attempting to read and print a <code>.txt</code> file line-by-line in Python using the <code>readline</code> function. The below code is intended to print out the entire text file line-by-line, but as of right now, it only prints out the first five lines of the text file.</p>
  <pre><code>filename = input(&quot;Enter the name and extension of the file you want to open.&quot;)
  file = open(filename, &quot;r&quot;)
  fileline = file.readline()
  for line in fileline:
      fileline = fileline.rstrip(&quot;\n&quot;)
      print(fileline)
      fileline = file.readline()
  file.close()
  </code></pre>
  <p>I expect the code to print out the entire file line by line, but it currently only prints out the first five lines. What is the bug in the code?</p>