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
The router is physically located in a server room that requires an ID card to gain access. You've backed up the router configura
ZanzabumX [31]

Explanation:

the best thing to do is to create a personal password with a two time passcode for better security of the device

4 0
3 years ago
Why is this cite so rigged
xxTIMURxx [149]
I don’t get what your asking?
8 0
3 years ago
Critics of media consumption
Mumz [18]

Answer:

b

Explanation:

make me brainlyest plzz

sorry if i got it wrong

5 0
3 years ago
Read 2 more answers
What is a web server?​
Zina [86]

Answer:

A computer that runs websites!

Explanation:

Hope this helps! :)

4 0
3 years ago
Write a program in main.c that reads the file lorum.txt and counts the number of characters on each line. Your program should cr
Aneli [31]

Answer:

A C programming language was used to write a file lorum.txt and counts the number of characters on each line.

Explanation:

Raw_Code :

#include<stdio.h>

int main(){

  FILE *read,*write;       //creating file pointers

  int line=1,count=0;

  char ch;

  read = fopen("lorum.txt","r");   //opening files to read and write

  write = fopen("count.txt","w");

  while((ch = getc(read))!=EOF){       //reading lines until end of the file

      if(ch == '\n'){                   //if new line character encountred

          fprintf(write,"%d: %d\n",line,count);       //Then printing count of that line to file  

          line++;                       //incrementing the count of lines

          count = 0;                   //making characters count to 0

      }

      else{

          count++;           //if it is not new line character then increasing character count

      }

  }

  fprintf(write,"%d: %d",line,count);   //writing last lines count to count.txt

  fclose(read);

  fclose(write);

  return 0;

}

4 0
3 years ago
Other questions:
  • Which topology enables only one person, at one time, to send data to others on the network?
    6·1 answer
  • What is the focus of developers interested in the Internet of things?
    11·2 answers
  • In order to install a device, the operating system needs the required __________ for that device.
    15·2 answers
  • You have just installed a SOHO router in a customer's home and the owner has called to say his son is complaining that Internet
    5·1 answer
  • List the five body functions that monitor homeostasis.
    7·1 answer
  • Which scenario is best for an online discussion group?
    5·1 answer
  • Question Mode Matching Question Match the following description with the appropriate programming language generation. 1GL 1GL dr
    7·1 answer
  • The metric unit used for length
    5·1 answer
  • Points! taga pilipinas ba kayo?​
    10·1 answer
  • Which of the following is not a valid Java identifier? a. Factorial, b. anExtremelyLongldentifierlfYouAskMe, c. 2ndLevel, d. Iev
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!