Aug-09-2021, 11:50 AM
(This post was last modified: Aug-09-2021, 06:34 PM by Yoriz.
Edit Reason: Added code tags
)
Hi,
I would like to open a text file in the loop and every time I would like to save a new line in the file but I have syntax error of "expected an indented block". How to fix that ?
I would like to open a text file in the loop and every time I would like to save a new line in the file but I have syntax error of "expected an indented block". How to fix that ?
i = 1
while i < 6:
f = open("readme.txt", "a")
f.write( str(i) + "\tHello\t" + "Now the file has more content!\n")
f.close()
i += 1
