1.

Is it possible to create a text file in python?(a) Yes(b) No(c) Machine dependent(d) All of the mentioned

Answer» The correct choice is (a) Yes

Best explanation: Yes we can create a file in python. Creation of file is as shown below.

file = open(“newfile.txt”, “w”)

file.write(“hello world in the new file”)

file.write(“and another line”)

file.close().


Discussion

No Comment Found