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 15:30
When creating a budget, log fixed expenses before income. after income. after savings. at the top.
Answers: 1
question
Computers and Technology, 22.06.2019 22:00
During physical science class ben and jerry connected three identical lightbulbs in parallel to a battery where happens when ben removes one of the lightbulbs from it’s socket
Answers: 2
question
Computers and Technology, 23.06.2019 11:20
Http is the protocol that governs communications between web servers and web clients (i.e. browsers). part of the protocol includes a status code returned by the server to tell the browser the status of its most recent page request. some of the codes and their meanings are listed below: 200, ok (fulfilled)403, forbidden404, not found500, server errorgiven an int variable status, write a switch statement that prints out the appropriate label from the above list based on status.
Answers: 2
question
Computers and Technology, 24.06.2019 00:10
Read each statement below. if the statement describes a peer-to-peer network, put a p next to it. if the statement describes a server-based network, put an s next to it. p - peer-to-peer s - server-based
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
question
Mathematics, 31.03.2020 00:22
question
Social Studies, 31.03.2020 00:22
question
Mathematics, 31.03.2020 00:22
question
English, 31.03.2020 00:22
question
History, 31.03.2020 00:22
Questions on the website: 13722360