Jan-16-2019, 06:03 PM
(This post was last modified: Jan-16-2019, 06:04 PM by gontajones.)
You need to add one more ENTER after
f.write(data)
.>>> f = open ("C:/doit/newfile.txt", 'w') >>> for i in range(1,11): ... data = "%d line. \n" % i ... f.write(data) <<ENTER AGAIN HERE>> >>> f.close()Doing this the interpreter will "close" the for loop.