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
Identify tags and attributes in HTML 5
Vaselesa [24]

Answer:

Tags can be identified as they are written as <tagname> Something </tagname>

<tagname> this tag is called start tag.

</tagname> this tag is called as end tag.

for ex:<p> This is a paragraph </p>

There are some elements with no end tag.for ex:- <br> tag.

Attributes are used to provide additional information to an HTML element.

Every element can have attributes.

for Ex:- <h1 style="background-color:red";>MY WEBSITE </h1>

So the background of h1 will become red.

7 0
3 years ago
What size hard disc is recommended for powerpoint writting
mixas84 [53]

Answer:

Depends on how many PowerPoint files you want to store and how long they are. I'd recommend at least a 256GB hard drive to store your OS and software and then leave space for PowerPoints.

5 0
3 years ago
What is the best application to create a slide show presentation?
Lynna [10]

Answer:

Microsoft Windows File Manager

5 0
3 years ago
Read 2 more answers
Synchronization barriers are a common paradigm in many parallel applications.
Bas_tet [7]

Answer:

I am not sure on this one I am guessing it is True

Explanation:

3 0
3 years ago
Question # 5
Mazyrski [523]

for num in range(4):

   print(num)

The output will be:

0

1

2

3

The for loop iterates through the numbers in the range function and prints those same numbers to the console.

6 0
2 years ago
Read 2 more answers
Other questions:
  • Danny is editing the text content of a single page on a website he created a year ago. What part of the tag would he have to upd
    11·1 answer
  • In this exercise we examine in detail how an instruction is executed in a single-cycle datapath. Problems in this exercise refer
    6·1 answer
  • Changing the configuration of a database falls under which category of databaseâ administration?
    15·1 answer
  • Convert the following pseudocode to C++ code. Be sure to define the appropriate variables. Store 25 in the speed variable. Store
    5·1 answer
  • Place the steps in order to link and place text into the document outline, effectively creating a master document.
    8·1 answer
  • Which library research databases include information about articles published in magazines, journals, and newspapers? question 1
    7·1 answer
  • Which of the following are correct? I. Hold the middle mouse button to rotate the model on the screen. II. To pan the model, hol
    15·1 answer
  • ____ a device receiving a process variable
    12·1 answer
  • What would the internet be like today if there was no World Wide Web?
    9·1 answer
  • Can someone please help me with this ,it is my assignment of technology and agriculture year 8
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!