1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
dusya [7]
3 years ago
10

Write a function called word_count that takes a single argument, a string containing the text of a single chapter, and returns t

he number of words in that chapter. Assume that words are separated from each other by spaces. Apply your function to compute the variable wc (defined in the cell below).
Computers and Technology
1 answer:
Ratling [72]3 years ago
3 0

Answer:

Hi there! There are a number of ways to achieve the word count result given an input text. The easiest method is explained below.

Explanation:

A simple Python script, word_count.py, can be used to calculate the word count program. The first argument is taken as the input text string (it needs to be enclosed in quotes (" ") in the command line). This input text is then split by spaces to capture the complete words list in an array. Finally, the length of the array equals the word count.

word_count.py

import sys;

text = sys.argv[1];

words = text.split(" ");

wc = len(words);

print(wc);

You might be interested in
Which component of a computer is its input device and what role does it play in a document?
hichkok12 [17]

a keyboard is a imput device that helps in writing in a document.

3 0
3 years ago
A _____________ is designed for a individual user.
pishuonlain [190]

Answer:

i don't know it sorry

Explanation:

7 0
3 years ago
3. In 1989, the first handheld console was released by _____ and it was called ________.
beks73 [17]
Answer: b) Nintendo, Game Boy

In 1989, the first handheld console was released by _Nintendo_ and it was called _Game Boy_.
5 0
3 years ago
I want to discard my old computer and want to securely erase the data from my hard drive what is the process called.
laiz [17]
I believe the process is called High Level Format.
8 0
4 years ago
Read 2 more answers
A speech why friends are important 2 min​
Gnoma [55]

Friends can challenge us, confuse us, and sometimes, we might wonder why we bother. But friendship is as important to our wellbeing as eating right and exercising. What’s more, friendships help us grow through each year of our lives.

The friends we meet in school teach us how to be patient, wait our turn, reach out, and try new hobbies. When we move into young adulthood we learn more about taking responsibility, finding a career path, and seeking out people as mentors.

As we continue into our 40s and beyond, we learn to weather the ups and downs in life, and once again friends provide a sounding board and place for us to grow. Friendship is key to our success with all our relationships and it can create a sense of purpose in our lives.

The people we bring into our lives as friends will show us how to forgive, laugh, and make conversation. The basic components of any relationship, from our marriage to our coworkers, are all founded in friendship. We learn how to interact with people because of our friends, even the ones that are opposite from us or share a different worldview.

We don’t just talk with others but learn from them. We understand the process of meeting new acquaintances and finding out what makes them tick. These people help push us out of our comfort zones while still providing a safe emotional space for us to be totally ourselves.

One of the most overlooked benefits of friendship is that it helps keep our minds and bodies strong. In fact, it’s as important to our physical health as eating well and keeping fit. A recent Harvard study concluded that having solid friendships in our life even helps promote brain health.

4 0
3 years ago
Other questions:
  • A curb of this color means you may stop only to pick up or drop offs passengers or male
    7·1 answer
  • Certain medications can increase risk of obtaining a sunburn true or false
    12·1 answer
  • (A) writer or word <br> (B) Calc or Excel <br> (C) impress or PowerPoint<br> (D) none of these
    14·1 answer
  • can you give me a tip to fix my SIM card becuaus when i put it on my phone it has no signal , can anyone fix this , thank you.​
    9·2 answers
  • Helen is working on her colleague’s photos. She came across this particular photo and was confused about which effect the photog
    15·2 answers
  • Complete the program below named CountVowels so that it reads in a string, counts all the vowels in that string, and prints out
    13·1 answer
  • A program virus infect​
    10·1 answer
  • what is required to successfully establish a connection between two routers using chap authentication?
    14·1 answer
  • How would the grain crusher work
    11·2 answers
  • Which organization provides a free, online html5 validator application to ensure that a webpage's html tags follow the rules for
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!