Answer to Question #3384 in Python for mukunda
Create a text file by using writelines() function?
1
2011-08-02T14:16:54-0400
fout = open ("textfile.txt", "w")
fout.writelines([(str(x) + "\n") for x in range(10)])
fout.close()
Need a fast expert's response?
Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
Learn more about our help with Assignments:
Python
Comments
Leave a comment