Question Detail
Question
What is the result of the following Python string slice:
word = "Python"
print(word[2:5])
Correct Answer
Option A is the correct answer.
Detailed Explanation
For
word[2:5], slicing starts at index 2 ('t') and goes up to, but not including, index 5. The characters at indices 2, 3, and 4 are 't', 'h', and 'o' respectively, resulting in 'tho'.
Hint
Identify the characters at indices 2, 3, and 4 in 'Python'.