Skip to content

Commit

Permalink
Create ass11.6.py
Browse files Browse the repository at this point in the history
  • Loading branch information
shuvojitss authored Oct 19, 2023
1 parent a666fd5 commit 40c6624
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions ass11.6.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
words = 0
line_count = 0

with open("home.txt", 'r') as f:
for line in f:
w = line.split()
words += len(w)
line_count += 1

print("Total words:", words)
print("Total lines:", line_count)


#Total words: 11
#Total lines: 2


home.txt
I live in Howrah.
The city is beside the river Ganga.

0 comments on commit 40c6624

Please sign in to comment.