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
blagie [28]
3 years ago
13

g Write a function called chain_words(str) which takes in one parameter which is a string that holds multiple words separated by

spaces. Your function should return a string with the words chained together with an - (hyphen). You can first split the words at spaces and then join the words with - (hyphen). You can achieve this by using split and join methods respectively.
Computers and Technology
1 answer:
Oduvanchick [21]3 years ago
7 0

Answer:

Explanation:

The following is written in Python. The function takes in a string as a parameter. It then sperates the string at every space. Then it rejoins the list of strings with hyphens. Finally, returning the newly created string with hyphens.

def chain_words(str):

   string_split = str.split(" ")

   seperator = '-'

   hyphen_string = seperator.join(string_split)

   return hyphen_string

You might be interested in
-1
N76 [4]

Answer:A flowchart is a diagram that depicts the steps involved in solving a problem. The following flowchart shows how to output the multiplication table ( n * 1 to m * 1) of a number, n and m:

3 0
3 years ago
Match the careers with the education required for each job
Gekata [30.6K]
Statistician for the last one network administaror for the next one then animator then broadcast tech
6 0
3 years ago
How can an individual find career data?
kolezko [41]
How can an individual find career data?a. using a libraryb. searching the webc. conducting an interview with someone in a particular fieldd. all answer choices are sources for finding career data?The answer is d. An individual can do all the option a, b, and c to find a better career data.
6 0
3 years ago
What is the full form of com​
nignag [31]

The answer is:

Commercial

3 0
2 years ago
Computer spreadsheet is a grid of​
Kruka [31]
Huh we’re, we’re is the computer screen shot
3 0
2 years ago
Other questions:
  • Which device or software application detects errors in system configurations?
    8·1 answer
  • When performing conflict management, it is important to identify your;
    6·1 answer
  • e do loop differs from the while loop in that a. the while loop will always execute the body of the loop at least once b. the do
    9·1 answer
  • 4. Together, what do the divisions of the DHSMV do? A. Make sure lines are long B. Use more money than other government organiza
    14·1 answer
  • Over the past few years a very definite need has arisen in the electrical trades for:
    15·1 answer
  • Compared to a virtual image, a real image
    15·2 answers
  • Which C99 function can be used to convert a string to a double?
    15·1 answer
  • Which are the 2 main elements that’s make up computer architecture?
    6·2 answers
  • Complete the following sentence.
    12·1 answer
  • Question 1 (True/False Worth 3 points)
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!