Write Python Program to Create File and read the contents without read() Method
filepath="C:\\Users\\Admin\\Desktop\\Python
Notes\\file1.txt"
with open(filepath,'r+')
as f:
f.write(" Hello Friends\n"
"How are you\n"
"What is going on")
for line in f:
print(line)
Output:
Hello Friends
How are you
What is going on Hello Friends
0 टिप्पण्या
कृपया तुमच्या प्रियजनांना लेख शेअर करा आणि तुमचा अभिप्राय जरूर नोंदवा. 🙏 🙏