Skip to content

Commit 02d54b4

Browse files
authored
Create readfilewordbyword.py
pls merge with hacktoberfest label
1 parent 2911e02 commit 02d54b4

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

python/readfilewordbyword.py

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Python program to read
2+
# file word by word
3+
4+
# opening the text file
5+
with open('GFG.txt','r') as file:
6+
7+
# reading each line
8+
for line in file:
9+
10+
# reading each word
11+
for word in line.split():
12+
13+
# displaying the words
14+
print(word)

0 commit comments

Comments
 (0)