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
jenyasd209 [6]
3 years ago
12

The function below takes a string argument sentence. Complete the function to return the second word of the sentence. You can as

sume that the words of the sentence are separated by whitespace and that there are at least two words in the sentence. You don't need to worry about removing any punctuation. (python)
def return_second_word(sentence):
Computers and Technology
1 answer:
Soloha48 [4]3 years ago
4 0

Answer:

Following are the program in the Python Programming Language.

# define function.

def return_second_word(sentence):

 #remove all the spaces from the sentence

 sentence=' '.join(sentence.split())

 #the list is split from spaces

 my_list = sentence.split(" ")

 #return the list

 return my_list[1]

#define main function

def main():

 #get input from the user

 se = input("Enter the sentence: ")

 #print and call the function

 print(return_second_word(se))

#condition to execute the main function

if __name__ == "__main__":

 #call main function

 main()

<u>Output:</u>

Enter the sentence: I love python

love

Explanation:

Here, we define the function i.e., "return_second_word()" and pass an argument "sentence", inside the function.

  • Remove all the spaces from the variable "sentence" and again store in the variable "sentence".
  • Set the variable "my_list" that store the split value of the variable "sentence".
  • Return the list and close the function.

Finally, we define the main function and inside the main function.

  • Get input from the user in the variable "se"
  • And pass the variable "se" in the argument list during the calling of the function "return_second_word()".
  • Then, print and call the function "return_second_word()".
  • Set the if statement to call the main function then, call the main function.
You might be interested in
Which one of the following UNIX utilities is purpose-built to quickly return the location (filepath) of files by querying a data
Galina-37 [17]

Answer:

a.locate

Explanation:

locate utility in Unix is used to quickly return the filepath of the file searched for.find also used to do the same work but it is not as fast as locate.

locate is faster than find because it does not read the filesystem to search the file infact it refers to the database to search the file and produces it's output and the database is created by updatedb command.

4 0
3 years ago
Difference between entropy and enthalpy is
olchik [2.2K]

Answer:

Explanation:

Enthalpy is the measure of total heat present in the thermodynamic system where the pressure is constant. Entropy is the measure of disorder in a thermodynamic system.

3 0
3 years ago
Which of the following is NOT a computer peripheral?
Marianna [84]

Answer:CPU stands for the central processing unit. CPU is not a peripheral device.

Explanation:

CPU stands for the central processing unit. CPU is not a peripheral device.

7 0
1 year ago
__________ is a strategy of using multiple types of technology that prevent the failure of one system from compromising the secu
Anastaziya [24]

Answer:

<u>Redundancy</u> is a strategy of using multiple types of technology that prevent the failure of one system from compromising the security of information.

Explanation:

Redundancy means having extra or duplicate resources available to support the main system. It is a backup or reserve system that can step in if the primary system fails. The reserve resources are redundant most of the time as they are not being used if everything is working properly.

8 0
3 years ago
What does ascii stand for?
tamaranim1 [39]
ASCII—American Standard Code for Information Interchange
7 0
3 years ago
Read 2 more answers
Other questions:
  • What are three settings that are available in the Properties dialog box of a message?
    9·2 answers
  • Transcoding digital videos does not cause a loss of quality. <br> a. True <br> b. False
    9·1 answer
  • What does Pentium means?:/
    7·2 answers
  • As discussed in the video, parallax measurements allow us to calculate distances to stars for which parallax is detectable. Supp
    14·1 answer
  • It is necessary tto save updates often when working in google docs? True or false
    11·2 answers
  • 9.6 Code Practice, this is in Python, I need its quick!
    13·1 answer
  • Select all the correct answers. Which two statements are true about electric current through a circuit? Current flows from a pos
    14·1 answer
  • Application for a lawn-mowing service. The lawn-mowing season lasts 20 weeks. The weekly fee for mowing a lot under 40 square fe
    13·1 answer
  • Can someone help me debug this please
    6·1 answer
  • Jacob holds a Computer Hacking Forensic Investigator (CHFI) certification. Which of the following responsibilities should Jacob
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!