We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1c3d3d4 commit 5a4febeCopy full SHA for 5a4febe
C05/co5_p1.py
@@ -0,0 +1,8 @@
1
+#Write a Python program to read a file line by line and store it into a list.
2
+
3
+fn = open("demo.txt",'r') #run in thonny (filename,mode)
4
+s= fn.readline() # for read line by line
5
+print(s)
6
+print(fn.closed) #file close status
7
+print(fn.mode) #file mode
8
+print(fn.name) #file name
C05/demo.txt
@@ -0,0 +1 @@
+Python is a high-level, general-purpose programming language
0 commit comments