Q. Write a program that will create an object called filout for writing, associate it with the filename STRS.txt. The code should keep on writing strings to it as long as the user wants.

 

Answer =

 



filout = open("Pathwalla.txt","w")

while True :
      txt = input("Enter text :-")
      filout.write(txt)
      filout.write( "\n" )
      user = input("For quit enter quit :-")
      if user == "quit":
            break
print("Thankyou")

filout.close()



Post a Comment

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

Previous Post Next Post