Skip to content

Commit 2f8f742

Browse files
author
Mofan Zhou
committed
create basic28
1 parent 3adc53b commit 2f8f742

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

basic/28_try.py

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
try:
2+
file = open('eeee', 'r+')
3+
except Exception as e:
4+
print('there is no file named as eeeee')
5+
response = input('do you want to create a new file')
6+
if response =='y':
7+
file = open('eeee','w')
8+
else:
9+
pass
10+
else:
11+
file.write('ssss')
12+
file.close()
13+
14+

0 commit comments

Comments
 (0)