Skip to content

Commit 9c1c663

Browse files
[consider-using-with] Use the template allowing multiple files
1 parent 943da0e commit 9c1c663

File tree

3 files changed

+1
-5
lines changed

3 files changed

+1
-5
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
file = open("apple.txt", "r", encoding="utf8") # [consider-using-with]
22
contents = file.read()
33
file.close()
4-
5-
worst = open("banana.txt", "r", encoding="utf8").read() # [consider-using-with]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
contents = open("apple.txt", "r", encoding="utf8").read() # [consider-using-with]
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
11
with open("apple.txt", "r", encoding="utf8") as file:
22
contents = file.read()
3-
4-
with open("banana.txt", "r", encoding="utf8") as f:
5-
best = f.read()

0 commit comments

Comments
 (0)