Post

Python Developer
Python Developer@Python_Dv·
Comment below the output! 😃👇
Python Developer tweet media
English
29
10
166
13.5K
Earnest Codes
Earnest Codes@Earnesto037·
@Python_Dv Answer: A). Creates & writes file The code opens a file named "demo.txt" in write mode ("w"). open("demo.txt", "w") creates the file if it doesn't exist, opens it for writing, and assigns the file object to the variable f. The "w" mode
English
1
0
14
828
Kamal Gurjar
Kamal Gurjar@KamalGurjar8·
@Python_Dv Correct answer: A) Creates & writes file Explanation: Opening a file with mode "w" creates the file if it doesn’t exist (or overwrites it if it does). f.write("Hello") writes the text into demo.txt, and f.close() saves and closes the file.
English
0
0
8
756
Unicorn Ranch .dev
Unicorn Ranch .dev@unicornRanchDev·
@Python_Dv creates and writes the code openes demo.txt in write mode then writes Hello into it and closes it
English
0
0
0
4
Paylaş