Q. Write a command(s) to write the following lines to the text file named hello.txt. Assume that the file is opened in append mode.

"Welcome my class"

"It is a fun place"

"You will learn and play"


Answer :-

f = open("hello.txt","a")
f.write("Welcome my class")
f.write("It is a fun place")
f.write("You will learn and play")
f.close() 

Post a Comment

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

Previous Post Next Post