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
A pangram is a sentence that contains all the letters of the English alphabet at least once. For example, the quick brown fox ju
erma4kov [3.2K]
Do you want this in paragraph form ?
5 0
2 years ago
_____ CRM systems are hosted by an external vendor in the vendor's data center.
PtichkaEL [24]

Answer: On- demand

Explanation:

 On demand CRM system are basically hosted by the external vendor in the vendor data center. CRM is basically stand for customer relationship management.

CRM is a strategy that are used for managing the organisation relationship with the customers.

On demand CRM define as software availability for the customers. It basically connected with the idea of software on demand. The software are modify according to the current requirement and demand.

8 0
2 years ago
Which of the following relate to the term Technology?
sp2606 [1]

Answer:

the answer is D.All of the above

7 0
2 years ago
Read 2 more answers
Not everything is a success all of the time! So do you know which version of Windows was the least popular?
mario62 [17]

Answer:

windows xp

Explanation:

I think because it is not fast and don't play the games and programs which have higher requirements

7 0
3 years ago
What is a shot sequence
Elan Coil [88]
A shot sequence is the time between when a shot is shot and when it lands
7 0
3 years ago
Other questions:
  • A geologist is part of what career feild
    6·1 answer
  • What view and zoom setting do you need for true WYSIWYG display? Why?
    14·1 answer
  • A complete traversal of an n node binary tree is a(n)____ "operation if visiting a node is O(1)for the iterative implementation
    5·1 answer
  • The ____ category of apps makes the computer easier for blind people to use.
    9·1 answer
  • A software-based _________ is dedicated to examining and blocking internet traffic.
    15·2 answers
  • Which of the following is an example of tangible property?
    5·1 answer
  • An effective team would never have ______.
    13·1 answer
  • Why is it uncommon for users to perform searches directly in database tables?
    15·1 answer
  • Which mark is an indicator of invalid data in a cell?
    11·1 answer
  • The goal of this project is to become familiar with basic Python data processing and file usage. By the end of this project, stu
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!