0 Reputation Points
100% Quality Score
- Upvotes Received
- 1
- Posts with Upvotes
- 1
- Upvoting Members
- 1
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
1 Posted Topic
fname= input("input a file name :") file = open(fname,"r") sentence = file.read() count = 0 print ("This program calculates the number of words ") words = sentence.split() characters = len(sentence) wordCount = len(words) for line in file.read().split('\n'): count += 1 print ("The total word count is:", wordCount) print ("The total …
The End.