subject

Implement a function printwordslines() that takes as a parameter the name of an input file. it opens the input file and then prints the number of lines and the number of words found in the file. words are strings separated by spaces, and lines are strings terminated by the newline character. don't forget to close the input file after you are done reading it. sample runs:
> > > printwordslines('test1.txt')

the file test1.txt contains 17 words and 3 lines

> > > printwordslines('test2.txt')

the file test2.txt contains 38 words and 5 lines

use python3.7

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 11:00
Describe three characteristics of at-risk drivers. a. b. c. describe three characteristics of safe drivers. a. b. c. describe three driver errors that could cause a collision. a. b. c. how will this information affect you as a driver now and in the future? (2-3 sentences)
Answers: 2
question
Computers and Technology, 23.06.2019 14:00
Need ! will choose brainliest! discuss the role of abstraction in the history of computer software.
Answers: 1
question
Computers and Technology, 24.06.2019 15:00
Universal windows platform is designed for which windows 10 version?
Answers: 1
question
Computers and Technology, 24.06.2019 15:00
In excel, what happens to the cell contents when you click and drag a cell into multiple cells?
Answers: 1
You know the right answer?
Implement a function printwordslines() that takes as a parameter the name of an input file. it opens...
Questions
Questions on the website: 13722367