Q. Write a method in python to write multiple line of text content into a text file mylife.txt line.
Answer =
file = open("mylife.txt", "w") l = [] while True: data = input("Enter the contents otherwise, Enter ""exit"" for stop the program :") if data == 'exit': break else : l = l + [data + '\n'] file.writelines (l) file.close ()
I think the program is wrong
ReplyDeleteWhy ???
Deletepotta
DeletePost a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )