Skip to content

Commit 7b43efd

Browse files
committed
Simpel file operations
1 parent acea245 commit 7b43efd

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

file_handling.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
file_name = "my_tasks.txt"
22

3-
with open(file_name, 'w') as f:
4-
f.write("1. Attend the meetup")
5-
f.write("2. Go home and get sleep")
6-
f.write("3. Make sure you had lunch before going to bed.")
3+
f = open(file_name, 'w')
4+
f.write("1. Attend the meetup")
5+
f.write("2. Go home and get sleep")
6+
f.write("3. Make sure you had lunch before going to bed.")
7+
f.close()
78

89
print("File written successfully")

0 commit comments

Comments
 (0)