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
Question 5
OverLord2011 [107]

Answer:

The answer to this question is given below in the explanation section.

Explanation:

This is a Python function that generates random number between the given range. However, it includes the numbers that are given in the range.

So this function can generate a random number and return a number between 1 and 9 (inclusive 1 and 9).

The function is written below

...........................................................................................................

import random

print(random.randint(1, 9))

<em>#returns a number between 1 and 9 (both included)</em>

.....................................................................................................................

4 0
3 years ago
Set of general format used to write program in any programming language?​
Novosadov [1.4K]

Answer:

hope you find it right

Explanation:

The process of writing computer instructions in a programming language is known as Coding.

A computer program is usually written by a computer programmer in a programming language. From the program in its human-readable form of source code, a compiler can derive machine code—a form consisting of instructions that the computer can directly execute.

That line of code is written in the Python programming language. Put simply, a programming (or coding) language is a set of syntax rules that define how code should be written and formatted. Thousands of different programming languages make it possible for us to create computer software, apps and websites.

In programming, code (noun) is a term used for both the statements written in a particular programming language - the source code , and a term for the source code after it has been processed by a compiler and made ready to run in the computer - the object code .

5 0
2 years ago
Unwanted email sent to large groups of people who did not request the communication is called _____
viktelen [127]
Spam mail is the answer
4 0
2 years ago
While developing a network application, a programmer adds functionally that allows her to access the running program without aut
Ierofanga [76]

Answer:

Backdoor

Explanation:

Backdoors are a method of covertly allows a users that are either authorized or unauthorized to bypass the measures put in place for security and obtain access to a network, computer system, embedded system or software, at a high level known as root access level

The uses of backdoors includes computer remote access security (access to remotely obtain passwords or delete hard drive data), and having access to a cryptographic system stored plain texts

5 0
2 years ago
What is a fire wall and how does it work
Ostrovityanka [42]

Answer:

a firewall is a network security system that monitors and controls incoming and outgoing network traffic based on predetermined security rules

8 0
3 years ago
Other questions:
  • Carlos owns a hardware store. He currently is not using any software to track what he has in the store. In one to two sentences,
    9·2 answers
  • What happens of the gamers dont follow the age ratings
    14·2 answers
  • Which of the following attack is a threat to confidentiality?
    10·1 answer
  • Harold included an excerpt from an Internet magazine in an article he wrote for the school newspaper. However, he did not ask pe
    13·2 answers
  • The___provides access to the internet; may also be internal
    11·1 answer
  • What are the top ten alternative songs of the 2000's?
    7·1 answer
  • Which symbol is at the beginning and end of a multiline comment block? ### &amp;&amp;&amp; %%% """
    14·1 answer
  • Choose the correct answer
    6·1 answer
  • Discuss seven multimedia keys​
    8·1 answer
  • Reesa works for a large real estate company. She is responsible for installing and supporting the company's internet systems, in
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!