Answer:
phrase[2:5]
Explanation:
Given:
The above code segment
Required
Which instruction returns 'u a'
First, we need to get the index of u in the phrase:
u is at the third position but in programming, index starts at 0.
So, u is at index 2
Next, we need to get the index of a in the phrase:
a is at index 4
One of the ways to return a sub string from a string in python is [tex]string[start:stop+1][/tex]
Where:
[tex]start = 2[/tex] ----- index of u
[tex]stop = 4[/tex] ----- index of a
phrase ---- The string variable
So, the instruction that returns 'u a' is: [tex]phrase[2:5][/tex]
Where 5 = 4 + 1