Q. Write a method in Python to write multiple lines of text contents into a text file daynote.txt line.


Answer =

 

def write () :
    f = open ("daynote.txt", 'w')
    while True:
        line = input ("Enter line:")
        f.write (line)
        choice = input("Are there more lines (Y/N):")
        if choice == 'N':
            break
f.close()


Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post