title: AttributeError: '_io.TextIOWrapper' object has no attribute 'next' python
body: <p>I am using python 3.3.3. I am doing the tutorial from tutorialspoint.com. I am unable to understand what this error is.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>fo = open("foo.txt", "w")
  print ("Name of the file: ", fo.name)
  
  # Assuming file has following 5 lines
  # This is 1st line
  # This is 2nd line
  # This is 3rd line
  # This is 4th line
  # This is 5th line
  
  seq = ["This is 6th line\n", "This is 7th line"]
  # Write sequence of lines at the end of the file.
  fo.seek(0, 2)
  line = fo.writelines( seq )
  
  # Now read complete file from beginning.
  fo.seek(0,0)
  for index in range(7):
   #  line = fo.next()
     print ("Line No %d - %s" % (index, line)+"\n")
  
  # Close opend file
  fo.close()
  </code></pre>
  
  <p>Error: </p>
  
  <pre><code>Name of the file:  foo.txt
  Traceback (most recent call last):
    File "C:/Users/DELL/Desktop/python/s/fyp/filewrite.py", line 19, in &lt;module&gt;
      line = fo.next()
  AttributeError: '_io.TextIOWrapper' object has no attribute 'next'
  </code></pre>