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, 22.06.2019 08:30
Active listen eliminates barries to communication true or false
Answers: 1
question
Computers and Technology, 22.06.2019 17:40
Consider the simple 3-station assembly line illustrated below, where the 2 machines at station 1 are parallel, i.e., the product only needs to go through one of the 2 machines before proceeding to station 2.what is the throughput time of this process?
Answers: 2
question
Computers and Technology, 23.06.2019 15:30
The song about casey jones a railroad engineer who gives his life on the job would most likely gall under the folk song category of? a-work song b-nonsense song c-religious song d-ballad
Answers: 1
question
Computers and Technology, 23.06.2019 20:00
Me ajude por favor , coloquei uma senha e não consigo tira-la no chorme
Answers: 2
You know the right answer?
Implement a function printwordslines() that takes as a parameter the name of an input file. it opens...
Questions
question
Computers and Technology, 28.02.2021 01:00
question
Mathematics, 28.02.2021 01:00
question
Mathematics, 28.02.2021 01:00
question
Mathematics, 28.02.2021 01:00
question
Mathematics, 28.02.2021 01:00
Questions on the website: 13722367