Answer:
The question asks for a program in Python. So i am providing Python code.
sentence = "Brocolli is delicious"
substring1 = sentence.find(' ')
substring2 = sentence.find(' ', substring1+1)
secondWord = sentence[substring1+1:substring2]
print(secondWord)
Explanation:
I will explain the code line by line.
First the sentence variable stores the string Brocolli is delicious.
find() function here is used to find the occurrence of the first space in the given sentence and this is stored in substring1. The first space occurs after the first word Brocolli of the given sentence.
substring2 = sentence.find(' ', substring1+1) In this statement find() function finds the occurrence of next space " " in the sentence after the first space which is stores in substring1. Now this indicates towards the end of second word is in the sentence because the second empty space comes after this word.
Lastly secondWord variable stores the second word of the line stored in sentence.
: operator shows the index of the substring1 + 1 which means that it starts from the substring1+1 of the sentence and ends at substring2 of the sentence. As we know substring1 has stored the position of the first space in the sentence so substring1+1 means the second word in the sentence i.e is. This will end at substring2 and we know that substring2 has stored the position of second empty space in the sentence. This is how the second word "is" is found and is stored in secondWord
At the end the value stored in secondWord i.e. is prints on the output screen.
The screen shot code along with output is attached.