Write a method in Python to write multiple lines of text contents into a text file, ''MYFILE.TXT'' line.
Answer:
def write():
f=open("MYFILE.txt",'w')
while True:
line=input("Enter a line: ")
f.write(line)
more_line=input("Are there more lines? Enter Y for yes and N for no: ")
if more_line == 'N':
break
f.close()