5) Write a program to read text to end-of-file, and print a count of word lengths, i.e. the total number of words of length 1 which occurred, the number of length 2, and so on. Define a word to be a sequence of alphabetic characters. You should allow for word lengths up to 25 letters. A typical output should be like this: length 1 : 10 occurrences length 2 : 19 occurrences length 3 : 127 occurrences length 4 : 0 occurrences length 5 : 18 occurrences

Answers

Answer 1

Answer:

Explanation:

The following code is written in Python. It is a function that takes in the name of the file to be read and the size of the word. Then the function reads the file, removes whitespace and commas, splits the text into words, and scans the words for all the words that have the same length as the number passed. It counts all those words and prints out the number of occurrences of words of that length.

def countOccurrences(file_name, word_size):

   f = open(file_name, 'r')

   text = f.read()

   text = text.replace(',', '')

   split_text = text.split(' ')

   occurrences = 0

   for word in split_text:

       if len(word) == word_size:

           occurrences += 1

   print("Length 1: " + str(occurrences) + " occurrences")

5) Write A Program To Read Text To End-of-file, And Print A Count Of Word Lengths, I.e. The Total Number

Related Questions

All changes
1.(01.01 LC)
To make sure you do not get too tired when using the computer for long periods of time, how often should you get up to stretch and move? (5 points)
O Every hour
O Every 10 minutes
O Every 30 minutes
O Every two hours

Answers

You should get up and move every 30 minutes

Hope  this helps

-scav

Answer:

C

Explanation:

Consider four Internet hosts, each with a TCP session. These four TCP sessions share a common bottleneck link - all packet loss on the end-to-end paths for these four sessions occurs at just this one link. The bottleneck link has a transmission rate of R. The round trip time, RTT, for all fours hosts to their destinations are approximately the same. No other sessions are currently using this link. The four sessions have been running for a long time. What is the approximate throughput of each of these four TCP sessions

Answers

It is what it is and can’t be what

The correct response is - The TCP protocol creates a three-way connection between hosts on a network to send packets. It is a connection-oriented protocol. It is a protocol found in the OSI network model's transport layer. Given that all lost packets are sent again, it is trustworthy.

What is a TCP protocol?

One of the key protocols in the Internet protocol family is the Transmission Control Protocol. It was first used to supplement the Internet Protocol in the first network installation. TCP/IP is the name given to the full suite as a result.

The usage of TCP allows for the safe exchange of data between the server and the client. No matter how much data is transferred across the network, it ensures its integrity. It is therefore used to transfer data from higher-level protocols that demand the arrival of all sent data.

The usage of TCP allows for the safe exchange of data between the server and the client. No matter how much data is transferred across the network, it ensures its integrity.

To read more about TCP protocol, refer to - https://brainly.com/question/27975075

#SPJ6

PLZZZZ HELP!!!
Select the correct answer.
What does the coding phase involve?
A.
testing and debugging code to remove all possible errors
B.
writing sequences of statements in a suitable programming language to produce the desired program
C.
designing a proper pseudocode using human-readable language
D.
compiling and interpreting programs into machine language
E.
breaking down the entire code into workable modules

Answers

I think the answer is b

Answer:

B.

writing sequences of statements in a suitable programming language to produce the desired program

Explanation:

During the coding phase, developers analyze the feasibility of each coding language and begin programming according to coding specifications. Without proper coding, the product won't function according to the customer's specifications, and new codes may need to be implemented

Edna needs a safer car to drive. She likes to travel a lot, so she is looking for a small SUV. She is trying to decide between buying a new or used car. After doing some research, she finds out that most cars lose value each year by a process known as depreciation. You may have heard before that a new car loses a large part of its value in the first 2 or 3 years and continues to lose its value, but more gradually, over time. That is because the car does not lose the same amount of value each year, but it loses approximately the same percentage of its value each year. What kind of model would be most useful for calculating the value of a car over time?

Answers

Answer: Buy a new car

Explanation: If its a used car its breaks will be worn out and more likely the breaks will stop working in 6 months and you have to change them. May the forse be with you.

Need help ASAP??? Pick the best answers

Answers

Answer:

A and C are correct pick both

A digital footprint is .

Answers

Your digital footprint is the trail of 'electronic breadcrumbs' you leave behind when you use the internet. It can include the websites you visit, the photos you upload and your interactions with other people on social networks.

Answer: is something you must manage

You want to change your cell phone plan and call the company to discuss options

Answers

And? What’s the point? The question?

Return the appropriate part of FizzBuzz This is a small part of a classic software engineering interview question. fizz_buzz_check takes a single integer argument, number. Complete the function such that it returns a value using the following rules: If the number is divisible by 3 (i.e division by 3 has a remainder of 0), return the string Fizz. If it is divisible by five, return the string Buzz. If it is divisible by 3 AND 5, return FizzBuzz. Otherwise, just return the original argument back without any changes.

Answers

Answer:

The function in Python:

def fizz_buzz_check(num):

   if num%3 == 0:

       result = "Fizz"

   if num%5 == 0:

       result = "Buzz"

   if num%3 == 0 and num%5 == 0:

       result = "FizzBuzz"

   if num%3 != 0 and num%5 != 0:

       result = num

   return result

Explanation:

The function to complete is not given. So, I write a new function from scratch.

This defines the function

def fizz_buzz_check(num):

This checks if num is divisible by 3

   if num%3 == 0:

If yes, the returned value is stored as "Fizz"

       result = "Fizz"

This checks if num is divisible by 5

   if num%5 == 0:

If yes, the returned value is stored as "Buzz"

       result = "Buzz"

This checks if num is divisible by 3 and 5

   if num%3 == 0 and num%5 == 0:

If yes, the returned value is stored as "FizzBuzz"

       result = "FizzBuzz"

This checks if num is not divisible by 3 and by 5

   if num%3 != 0 and num%5 != 0:

If yes, the returned value is stored as the initial argument

       result = num

This returns the appropriate value

   return result

NO LINKS
Do you need to pay monthly to stream on Twitch?

Answers

I think so yeah $$$$

Why using a word processor than a typewriter?​

Answers

Answer:

Word processors allow users to save documents. This is not the case with a typewriter. Because text can be saved, editing does not have to occur immediately. The fourth characteristic of word processors is that they allow users to print their documents.

Answer:

There are many advantages to using a word processor instead of a typewriter. ... You have the ability to easily edit and change a word processing document. You can change a wide variety of formatting and colours. You can save files and re-use them.

Explanation:

Which option is the default configuration of the Junk Email Options in Outlook 2016?

No Automatic Filtering
Low
High
Safe Lists Only

Answers

Answer:

No Automatic Filtering

Answer:

NO automatic filtering

Explanation:

i took the quiz

⚠️⚠️⚠️⚠️HELP - What is the software that allocates resources of a physical computer to a virtual machine?
Group of answer choices

Switch

Operating systems

Hypervisor

HostVM

Answers

Answer:

the answer is going to be hostvm

What do y’all think are the pros and cons to using technology?

Answers

Answer:

Explanation:

pros. convenient, easy to use, and educational  cons. addictive, mentally draining, and creates a social divide.

how do you think the blitz might have affected civilian morale in london

Answers

Answer:

It would have seriously negatively affected civilian morale in London. Hearing about the horrors of the war even from far away does a number on morale. This, however, was not exactly the case for London in WWII, because even as air raids were executed on the city, the citizens, confined to underground bomb shelters, still managed to pull together and keep morale high, causing London NOT to plunge into chaos, but to stand united against Germany.

Aspire is a test you take to prepare for the
A. PSAT
B. SAT
C. ACT
D. FAFSA

Answers

Answer:

ACT

Explanation:

"ACT Aspire is a powerful tool to help students and their parents monitor progress toward a successful ACT test from third grade through tenth grade. The Aspire test assess students' readiness in five areas covered by the ACT test: English, math, reading, science and writing." - https://greentestprep.com/resources/act-prep/act-aspire-test/

Aspire is a test you take to prepare for the ACT. Thus, option C is correct.

What is ACT?

"ACT Aspire is a powerful tool to help students and their parents monitor progress toward a successful ACT test from third grade through tenth grade. The Aspire test assess students' readiness in five areas covered by the ACT test: English, math, reading, science and writing.Aspire is a test people take as a preparation for both ACT a d SAT.

Aspire is a valuable tool to help students and their parents monitor progress towards a good ACT exam from 3rd to 10th grade. The Aspire test assesses student performance in five areas covered by the ACT exam: English, math, reading, science and writing. Aspire Test is offered in the spring and fall seasons, the cost of the assessment tool depends on how many subjects you would like to measure and how often you want your student to be tested.

Learn more about Aspire Test on:

https://brainly.com/question/4469429

#SPJ7

who was the first inventor of computer​

Answers

Answer:

Explanation:

English mathematician and inventor Charles Babbage is credited with having conceived the first automatic digital computer. During the mid-1830s Babbage developed plans for the Analytical Engine.

Answer:

Charles Babage is the first inventor of computer.

What keys on the keyboard have the ability to move the cursor around on a window?

No links and files or I report!
Will give Brainliest!​

Answers

Answer:

Press the Windows key on your keyboard. In the box that appears, type Ease of Access mouse settings and press Enter . In the Mouse Keys section, toggle the switch under Use numeric pad to move mouse around the screen to On. Press Alt + F4 to exit this menu.

All of the following are problem-solving steps except:
A. taking action.
B. defining the problem.
c. doing the first solution that comes to mind.
D. creating possible solutions.

Answers

Answer:

C. Doing the first solution that comes to mind.

Explanation:

Lets break this down a bit.

A is a great problem solving step, so we can mark that off.

We can do the same for B.

However, for C, I am hesitant about this one, so I wont mark it off quite yet.

Finally, for D, it is definitely a step, so I can mark that off.

You should never do the first solution that comes to mind, since you haven't done enough brainstorming about other ideas.

Hope this helps!

A financially stable person is able to:
A. spend money without having to save.
B. use loans to cover his or her living costs.
C. default on loan payments.
D. save money.

Answers

I think D. To save money cuz thats how financially stable people stay financially stable

Answer:

Save Money

Explanation:

D

Microsoft Security Essentials and Microsoft Forefront are: anti-malware software programs that can be used to harden workstation computers. port-scanning software utilities that scan for open ports on servers. software programs designed to remove or disable unnecessary user accounts. operating system administration software programs that create and maintain baselines.

Answers

Answer:

anti-malware software programs that can be used to harden workstation computers

Explanation:

Microsoft Security Essentials can be regarded as antivirus software which gives protection to our computers used in home or for business against types of malicious software. These malicious software could be

✓trojan horses.

✓ computer viruses

✓spyware

✓rootkits, trojan horses.

Microsoft Forefront can be regarded as

security software for business roduced

by Microsoft Corporation. It was

designed to offer protection to computer networks as well as network servers and individual devices. It should be noted that Microsoft Security Essentials and Microsoft Forefront are anti-malware software programs that can be used to harden workstation computers

What are the two main parts of system unit hardware?

Answers

Answer: Computers have two main parts: hardware and software

Like piano (hardware) and music (software)

Explanation:

Who is the one you shouldnt have killed from fnaf?
(I already know but whoever answers first and right gets brainlest)

Answers

Answer: He was thought to be one of William Aftons victims who is also thought to be the child who possessing golden freddy

Explanation:

Answer:

Cassidy I guess

6.20 LAB: Acronyms An acronym is a word formed from the initial letters of words in a set phrase. Write a program whose input is a phrase and whose output is an acronym of the input. If a word begins with a lower case letter, don't include that letter in the acronym. Assume there will be at least one upper case letter in the input. Ex: If the input is: Institute of Electrical and Electronics Engineers the output should be: IEEE

Answers

Answer:

Explanation:

The following code is written in Python. It creates a function that takes in a phrase as an argument. Then it splits the phrase into a list of words. Next, it loops through the list and adds the first letter of each word into the acronym variable if it is a capital letter. Finally, returning the acronym variable. Output can be seen in the attached picture below.

def accronymGenerator(phrase):

   phrase_split = phrase.split(' ')

   acronym = ""

   for x in phrase_split:

       if x[0].isupper() == True:

           acronym += x[0]

       else:

           pass

   return acronym

HELPPPPPP How is does technology impact the career of your choice? Write 5-6 sentences about how technology impacts the career of your choice.

Answers

Answer:

Explanation:

Summary. Technology has had a dramatic impact on the nature of work itself, individual applicants and employees, employers, and career counselors. It has changed the nature of work and the types of jobs that people do today. It has altered the knowledge and skills individuals need to be effective workers.

A customer opened a file attachment, and now her PC is infected with ransomware. She's unable to open any of her files. Which action would you take first?
A. Reinstall the operating system
B. Run an antivirus scan
C. Pay the ransom to recover the data
D. Disconnect the PC from the network
E. Restore files from backup

Answers

Answer:

D. Disconnect the PC from the network

Explanation:

I'd say this because it keeps the ransomware from spreading to other computers making it a bigger problem.

In this question, the answer is "Option D", which disconnects the PC from the network, which can be defined as follows:

A customer's PC has been attacked using ransomware after she opened a document file. She has been unable to access any of her files. She first had to detach the PC from the system to access the file.This type of malicious software (malware) threatens to publish or prevent information or computer access until the victim pays a ransom price to the attacker. Today, ransomware assaults are all too frequent. This attacker then demands a ransom from the victim, promising to restore access to the information in exchange for payment.

The wrong option can be defined as follows:

In option a, it is wrong because when we reinstalling the OS is used to start the fresh without using the old files.In option b, it is wrong because the antivirus can't protect the ransomware maliciously. In option c, it is wrong because when a corporation can pay the ransom, their cash is dispersed across the dark web.In option e, it is wrong because creating copies of information could be recovered in the event of a primary information failure.

Learn more:

Ransomware: brainly.com/question/14455233

they will wash the car change into tag question​

Answers

Answer:

They will wash the car, won't they?

Explanation:

A tag question usually comes after an independent clause. The tag question is most times attached with the intent of affirming the statement made in the independent clause. Our independent clause in the answer above is; "They will wash the car". The tag question, "Won't they?" is meant to affirm that statement.

Another example is, "They are going to school, aren't they?" In this example also, the independent clause makes a sentence that is to be confirmed by the tag question.

Can someone plz answer these questions plz

Answers

Answer:

ñbyte I'm pretty sure, sorry if u get it wrong you should do more research about the question if i get it wrong!!

Mattias's friend asked him to critique his presentation about gorillas. Mattias noticed that there weren't any images of gorillas. What feedback can Mattias give to improve his friend's presentation?
a I like your title, but did you not think to add pictures of gorillas?
b It's ok, but it would be better if I just added pictures to your presentation.
c Really great information, but I think adding a picture of a gorilla would be great.
d You're missing a gorilla picture. Add one.

Answers

Answer:

c

Explanation:

Answer:B

Really great information, but I think adding a picture of a gorilla would be great.

Explanation:

Mattias's friend asked him to critique his presentation about gorillas. Mattias noticed that there weren't any images of gorillas. What feedback can Mattias give to improve his friend's presentation?

Group of answer choices

A)You're missing a gorilla picture. Add one.

B)Really great information, but I think adding a picture of a gorilla would be great.

C)I like your title, but did you not think to add pictures of gorillas?

D)It's ok, but it would be better if I just added pictures to your presentation.

The following table represents the addresses and contents (using hexadecimal notation) of some cells in a machine's main memory.Starting with this memory arrangement , follow the sequence of instructions and record the final contents of each of these memory cells: Address Contents 00 AB 01 53 02 D6 03 02 Step 1. Move the contents of the cell whose address is 03 to the cell at address 00. Step 2. Move the value 01 into the cell at address 02. Step 3. Move the value stored at address 01 into the cell at address 03.

Answers

Answer:

I DON'T KNOW THE ANSWER SO SORRY

Explanation:

BUT THANKS FOR THE POINTS

Which option is used to determine whether information that should remain private is included in the final version of a PowerPoint presentation?
Compatibility Check
Grammar Checker
Document Inspector dialog box
Trust Center

Answers

Answer:

Im pretty sure you should put a document inspector dialog box

Answer:

Document Inspector dialog box

Explanation:

edge 2022

Other Questions
Ashley plans to run a total of 24 miles this week. If Ashley has already run 25% of the total distance, how many more miles does she plan to run this week?A. 6 milesB. 20 milesC. 4 milesD. 18 miles How is racism socially constructed in our culture ? 0.9x+2.3x = -6.4 Find x on both sides of the problem, a little confused... Would we combine the like terms on the left side? A merry go around has a radius of 18 ft. If a passenger gets on a horse located at the edge of the wheel and travels 38ft, find the angle of rotation to the nearest degree carpenter has a board that is 8 feet long. e cuts off two pieces. One piece is 32 feet ug and the other is 2 feet long. How ch of the board is left? What was Booths original plan to save the Confederacy? Why did it fail? You pull a marble from a bag with 20 red 20 white and 10 green marbles. You hold onto it and then pull another marble. What is the probability of pulling a red marble and then pulling a green marble? When Billy's asked how old he is, he replies, "In two years i will be twice as old as i was 5 years ago." How old is he? Hey can you help me fast!!! A train arrives at the station with 150 passengers on board. 2/5 of the passengers get off the train in seattle , and then 35 passengers board the train . How many passengers are on the train when it leaves the station? You look bad! You look like that scraggly white kid from Disney shows. To the nearest tenth of a centimeter what is the length of side ab which type of specialized cells would be found in an animals neuvous system? "Determine which three lengths cannot be the measure of the sides of a triangle. 2 m, 5 m, 6 m 8 m, 10 m, 17 m 5 m, 20 m, 22 m 4 m,15 m, 20 m" Your assignment is to discuss in writing at least two techniques you use (or will use or will suggest to others) to help handle mental stress. Include at least two references you use to support your techniques. One reference can be your textbook. **I will do the textbook part** What is the product of the polynomials below?(4x^3+8x)(x^2-3) CPR is required when a heart attack leads towhat?A. lethargyB. an obstructed airwayC. cardiac arrest Choose the term that best matches the description given.The act that has its own definition and remedial steps for mistakenly created e-commerce contracts:Pls help me. I will give best answer What purpose does the endosperm serve in the seed? The title: "Two Very Different Sides" implies that the author is using the text structure-a) comparatively b) chronological