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
Cerrena [4.2K]
2 years ago
5

Assume that sentence is a variable that has been associated with a string consisting of words separated by single space characte

rs with a period at the end. For example: "This is a possible value of sentence." Write the statements needed so that the variable secondWord is associated with the second word of the value of sentence . So, if the value of sentence were "Broccoli is delicious." your code would associate secondWord with the value "is" . (python)my answer wassecondWord = sentence.substr(sentence.find(" ") + 1)secondWord = secondWord.substr(0, secondWord.find(" "))but i am keep on getting error message saying ⇒ You almost certainly should be using: [ ] ⇒ We think you might want to consider using: : ⇒ Solutions with your approach don't usually use: , (comma)
Computers and Technology
1 answer:
Nezavi [6.7K]2 years ago
3 0

Answer:

When you are working with substrings in python you should treat the strings as lists, according to your answer the corrected code is given below:

sentence = "This is a possible value of sentence."

secondWord = sentence[sentence.find(" ")+1:]

secondWord = secondWord[0:secondWord.find(" ")]

print(secondWord)

Explanation:

#Define the value of the sentence for testing

sentence = "This is a possible value of sentence."

#Define a variable temp that starts when a blank space is find in the sentence to the end, sentence[n:] --> means everything in string after index "n"

temp = sentence[sentence.find(" ")+1:]

#Define the secondWord variable, you start at index 0 because in temp we already delete the first word and ends when finds the other blank space.

secondWord = temp[0:temp.find(" ")]

print(secondWord)

You might be interested in
An online bank wants you to create a program that shows prospective
ladessa [460]

Answer: I can't really code a whole thing for you but use VS Code for this it'll make your life easier in the long run.

8 0
2 years ago
What is the term for an element on a Webpage that contains data and procedures for how that item will react when activated
dezoksy [38]

Answer:

It is an object.  And this is because an object has the data and procedures that defines how it is going to react when it is going to be activated. The data is the details about the object, and it explains what the object actually is. And the procedures are the details of the functions that the particular objects can perform. Like for a hospital, data can be mentioning list of medication services they provide, and procedure can be like registering for any medication service, the complete process.

Explanation:

The answer is self explanatory.  

6 0
2 years ago
What is a programming method that provides for interactive modules to a website?
Veseljchak [2.6K]

Answer:

Java?

Explanation:

8 0
3 years ago
How many iphones have Apple sold in 2019?
Phoenix [80]

Answer:

40.7 million iphones

Explanation:

Gupta. Apple's iPhone sales continued to decline in the third quarter of 2019. Apple sold 40.8 million iPhones, a year-over-year decline of 10.7%.

3 0
3 years ago
Read 2 more answers
In an attack known as ____, valid protocol packets exploit poorly configured dns servers to inject false information to corrupt
ladessa [460]

This is known as DNS poisoning, so called because it 'poisons' the entries of the DNS with false information.

8 0
3 years ago
Other questions:
  • What is primary storage
    11·2 answers
  • Which routine is configured to be called by another routine?
    10·1 answer
  • 3. Before you get ready to go diving, you want to explore the area. You see a small snowpack across a small bridge, a short walk
    11·1 answer
  • What is the best operating system
    12·1 answer
  • Which of the following are examples of how a company might use consumer data it had collected? a To decide what types of product
    10·1 answer
  • Anyone wanna join zoo m???????​
    10·2 answers
  • How many questions have you seen so far other than this one?
    10·2 answers
  • Edhesive 2.3 code practice question 1​
    11·1 answer
  • Five plus six is equal to?​
    10·2 answers
  • First Computers and Technology question in 4 years..
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!