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
castortr0y [4]
3 years ago
5

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. If the sentence contains less than two words, return None. If the last character of the word you are returning is a comma, semi-colon, period, exclamation point, or question mark, remove that last character.
Computers and Technology
1 answer:
enyata [817]3 years ago
3 0

Answer:

Following are the code to this question:

def string_argument(val): #Defining a method string_argument

   w= val.split() #Define variable that split value

   if len(w) < 2: # Define condition to check value length  

       return None #return value

   if w[1][-1] in ",;.!?": #Define condition to check special character  

       return w[1][:-1] #return second word

       return w[1] # return value

print(string_argument("good morning hello?")) #call method and print return value

print(string_argument("hii morning, DEV"))#call method and print return value

print(string_argument("how are you? MR"))#call method and print return value

print(string_argument("dev lambda. Who"))#call method and print return value

print(string_argument("thanks")) #call method and print return value

Output:

None

morning

None

lambda

None

Explanation:

In the given python program, a method "string_argument" is declared, that accepts a value val in its parameter, inside the method, another variable "w" is used, that splits the argument value. In the next line, two if conditional block is used which can be described as follows:

  • In the first block, it will check the length, it is not less then 2, if this condition is true it will return none.
  • In the second if the block it will check, that variable val holds any special character in its second word so, it will return the second word.
You might be interested in
It is important for security practitioners to take into consideration the __________ element when devising password security pol
N76 [4]

Answer:

The answer is "Evidence".

Explanation:

A "practitioner" is a person that has a specific practice or specialty directly involved. A safety professional of data is indeed another who engages in the protection of data.

Evidence is used in the course of the investigation to show certain material information or characteristics of a felony. Most people seem to believe that proof is just tangible, verbal evidence.

4 0
3 years ago
Exampels of semantic tags ?​
spayn [35]
A semantic element clearly describes its meaning to both the browser and the developer.Examples of non-semantic elements: and <span> - Tells nothing about its content. Examples of semantic elements: ,, and - Clearly defines its content.</span>
4 0
3 years ago
A _____ is a machine that changes information from one form into another.
gavmur [86]
The answer would be computer
5 0
3 years ago
What are the steps for creating a bookmark? 1. Place the insertion point where the bookmark should appear. 2. Click the tab. 3.
Paladinen [302]

Answer:

2. Insert

3. Links

4. Add

6. Advanced

Explanation:

HTML is an acronym for hypertext markup language and it is a standard programming language which is used for designing, developing and creating web pages.

A website refers to the collective name used to describe series of web pages linked together with the same domain name.

On the other hand, a webpage is the individual HTML document (single page) that makes up a website with a unique uniform resource locator (URL).

A bookmark can be defined as a placeholder or saved shortcut for a webpage and for future reference. Thus, it avails an end user the ability to quickly access a bookmarked webpage by automatically directing the web browser to the webpage.

Basically, the steps for creating a bookmark are;

1. The insertion point of the webpage should be placed at the point where the bookmark should appear.

2. Click the "INSERT" tab.

3. In the "LINKS" group, click "Bookmark"

4. When a dialog box opens, the bookmark should be named with a specific title, and then click "ADD"

5. To see bookmarks within the HTML document, you should go to Backstage view and click on "Options"

6. In ADVANCED, select Show Bookmarks to have them appear as a locked cursor within the HTML document.

6 0
3 years ago
True and False(Total points: 10)
Gwar [14]

Answer:

1.T 2.f 3.t 4.f 5.f 6.f 7.t 8.t 9.f

8 0
3 years ago
Read 2 more answers
Other questions:
  • Christine wants to send a quick communication to all department managers. She should send a _____. report
    13·2 answers
  • Which of the following expansion ports would be used to enable transfer of power, data, and video to peripheral devices on an Ap
    7·1 answer
  • Wich technology can a website use to allow you to listen to a concert live over the internet?
    10·1 answer
  • a) Before writing any code, you should go through a design process. Try to do so carefully – either follow a top-down approach,
    15·1 answer
  • Mika forgot to put in the function name in his function header for the code below. What would be the best function header?
    12·2 answers
  • What does the revolver do computer science​
    9·1 answer
  • Find the basic period and basic frequency of the function g(t)=8cos(10πt)+sin(15πt)
    9·1 answer
  • Help asap !!!<br>which component of cpu controls the overall operation of computer..​
    9·1 answer
  • Which task would most likely be completed by a physician’s assistant?
    12·1 answer
  • After reading his e-mail messages, Orlando became very frustrated. Many of the messages he received did not conform to netiquett
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!