Q.

Is it possible to create a text file in python?

A. yes
B. no
C. machine dependent
D. all of the mentioned
Answer» A. yes
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\n”) file.write(“and another line\n”) file.close().
2.7k
0
Do you find this helpful?
31

Discussion

No comments yet