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]
3 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]3 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
Which description best applies to a macro?
Mama L [17]

A macro is that pseudo-program that performs a list of actions based on a set of instructions.

<h3>What is macro?</h3>

A macro can be said to be a number of commands that help you to get complex things done via automating simple and via repetitive tasks.

A macro is that pseudo-program that performs a list of actions based on a set of instructions.

Therefore, option A is correct as the macros does a whole lot of work.

Learn more about macro from

brainly.com/question/20050035

#SPJ1

6 0
2 years ago
how to create use an array of Course objects instead of individual objects like course 1, course 2, etc
AURORKA [14]

Answer:

To save the course object instances in an array, use;

Course[] courses = new Course[7];

courses[0] = new Course("IT 145");

courses[1] = new Course("IT 200");

courses[2] = new Course("IT 201");

courses[3] = new Course("IT 270");

courses[4] = new Course("IT 315");

courses[5] = new Course("IT 328");

courses[6] = new Course("IT 330");

Explanation:

The java statement above assigns an array of size 7 with the course class constructor, then order courses are assigned to the respective indexes of the new array.

3 0
3 years ago
when a user has the requirement to stay connected 100% of the time as they move throughout the WLAN coverage area, what are they
zimovet [89]
They are concerned about many things
5 0
3 years ago
Stages of reverse engineering
ivann1987 [24]

Answer:

Capture Data, Refine the Model, and then Manufacture it.

Explanation:

5 0
2 years ago
The AND operator is a disjunction and the OR operator is a conjunction.
qwelly [4]

Answer:

True but it might be false but i think is true

8 0
2 years ago
Other questions:
  • Directions Use your imagination and a word processor to write a business letter with two to three paragraphs. Your business lett
    5·1 answer
  • Which software application should be used to create a sales pitch to a group of people? Database Email Presentation Word process
    9·1 answer
  • 12. Good digital citizenship includes keeping in mind who has access to the internet and who does not. (1 point)
    15·2 answers
  • Which answer best describes an unsubsidized federal loan
    9·1 answer
  • Variables in PHP must begin with what symbol?
    11·1 answer
  • NEED HELP NOW 25 POINTS!!!!!!
    15·2 answers
  • The main part of your program has the following line of code.
    7·1 answer
  • Write a function that will sum all of the numbers in a list, ignoring the non-numbers. The function should takes one parameter:
    8·1 answer
  • Most file managers include a way to create a folder through the save dialog box. true or false?
    9·1 answer
  • How does a Cloud-first strategy approach a client's migration to the Cloud?by removing outside ecosystem partners from the Cloud
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!