Q. Write a function to insert a sentence in a text file, assuming that text file is very big and can't fit in computer's memory.


Answer = 


def add(sen) :
	f.write("\n"+ sen)

f = open("pathwala.txt",'a')
sen = input("Enter a sentance :-")
add(sen)

f.close()


1 Comments

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

  1. How the text 'assume file is too big' changed the ans

    ReplyDelete

Post a Comment

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

Previous Post Next Post