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
Ghella [55]
3 years ago
14

: Write a function "def countWords(string)" that returns a count of all words in an input string represented by the variable 'st

ring'.
Computers and Technology
1 answer:
Zina [86]3 years ago
3 0
We can define a word as a group of characters without a space between them. To find the words of the input string , w can use split(delimiter) which returns a list of strings which had the defined delimiter between them in the input string.

def countWords(string):
words = string.split(" ")
count = len(words)
return count

Here we set the delimiter as the space character, and returned the length of the words list. I split each step into its own line for readability, however the function could be one line:

return len(string.split())

Here, no delimiter is specified. If one isn't given, it will default to split at any whitespace, including space.

You might be interested in
freeeeeeeeeeeeeeeeee poiiiiiiiiiiiiiiiiiiiiiiiiiinnnnnnnnnnnnnnnnnnnnnnttttttttttttttttttttttttsssssssssssssssssss
Jlenok [28]

Answer:

i want some

Explanation:

EEEEEEEEEEE

7 0
3 years ago
Read 2 more answers
Which RAID configuration, known as byte-striped with error check, spreads the data across multiple disks at the byte level with
wel

Considering the computer system technology, the RAID configuration, known as byte-striped with an error check, and spreads the data across multiple disks at the byte level with one disk dedicated to parity bits is known as <u>RAID Level 5.</u>

<h3>What is the RAID Level 5?</h3>

RAID Level 5 is the Redundant Array of Inexpensive (or Independent) Disks Level 5. RAID Level 5 works on strips to transfer data over multiple disks in an array.

RAID Level 5 is also known to record information, with the ability to withstand numerous failures.

<h3>Other types of Redundant Array of Inexpensive (or Independent) Disks</h3><h3 />
  • RAID level 0
  • RAID level 1
  • RAID level 2
  • RAID level 3
  • RAID level 4

Hence, in this case, it is concluded that the correct answer is RAID Level 5.

Learn more about RAID configuration here: brainly.com/question/9305378

8 0
3 years ago
Given two int variables , firstplacewinner and secondplacewinner, write some code that swaps their values . declare any addition
Mekhanik [1.2K]
Int tmp;
tmp = firstplacewinner;
firstplacewinner = secondplacewinner;
secondplacewinner = tmp;
5 0
3 years ago
Describe how place value is used in the binary number system. How is it similar or different from the way place value is used in
daser333 [38]
The binary number system is also referred as base-2 numeral system. The numeric values in the binary system are represented with only two symbols "0" and "1". The base 10 number system on the other hand is the usual number system that uses decimal numbers.
In the binary system the number to the left of the point is a whole number and every number further left gets 2 times bigger. The first digit on the right means halves and every number further right is 2 times smaller.
In the base 10 system number greater than 1 appear to the left of a decimal point. Values that are a fraction appear to the right of the decimal point. Every number further  left is 10 times bigger, and right 10 times smaller.







7 0
3 years ago
If you cut a piece of text but intended to copy it, what command can you use to correct your error?
Assoli18 [71]

Answer:

It should be undo, as the deleted text is pasted. You can then, copy it.

5 0
4 years ago
Read 2 more answers
Other questions:
  • How does consumption of alcohol affect your driving skills? Name three ways that alcohol can affect your driving.
    15·2 answers
  • Where does the VLookup function find its lookup values?
    14·1 answer
  • Which of the following types of tool should be used only on round work, such as rigid or IMC conduit?
    6·2 answers
  • SATCOM in the Ku- and Ka- bands, as well as EHF systems are adversely affected by rain (the higher the frequency, the greater th
    14·1 answer
  • With a DUI charge on a driver’s record ______________.
    10·1 answer
  • Which statement regarding killers is true?
    12·2 answers
  • How does design influence the product's function?
    5·1 answer
  • Which sentence in the passage shows an effective way to protect your document from misuse? Claire has saved her research paper o
    14·1 answer
  • How bridges are built over water
    14·1 answer
  • How can edge computing be used to increase sustainability
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!