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 afbb144 commit 65425b4Copy full SHA for 65425b4
1 file changed
implement-shell-tools/wc/wc.py
@@ -1,13 +1,13 @@
1
import sys
2
3
args = sys.argv[1:]
4
-path = args[0]
5
6
-with open(path, "r") as file:
7
- content = file.read()
+for path in args:
+ with open(path, "r") as file:
+ content = file.read()
8
9
-lines = content.split("\n")
10
-words = content.split(" ")
11
-chars = content
+ lines = content.split("\n")
+ words = content.split(" ")
+ chars = content
12
13
-print(len(lines), len(words), len(chars))
+ print(len(lines), len(words), len(chars), path)
0 commit comments