Skip to content

Commit 43763fb

Browse files
committed
rewrite
1 parent 94ca07c commit 43763fb

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

C05/co5_p1.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,20 @@
22

33
fn = open("demo.txt",'r') #run in thonny (filename,mode)
44
s= fn.readline() # for read line by line
5-
print(s)
5+
print(s)
6+
fn.close()
67
print(fn.closed) #file close status
78
print(fn.mode) #file mode
89
print(fn.name) #file name
910

11+
1012
fo =open("demo2.txt","w")
1113

1214
fo.write("Python is dynamically-typed and garbage-collected. It supports multiple programming paradigms")
13-
fo.close()
15+
fo.close()
16+
17+
f2 =open("demo2.txt","w")
18+
f2.write("Python gdgg")
19+
f2.close()
20+
21+

C05/demo2.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Python is dynamically-typed and garbage-collected. It supports multiple programming paradigms
1+
Python gdgg

0 commit comments

Comments
 (0)