QUESTION IMAGE
Question
question # 6
multiple choice
what is the missing line of code?
>> sentence = \programming is fun!\
>>
gra
sentence2:6
sentence2:5
sentence3:5
sentence3:6
Brief Explanations
In Python, string slicing string[start:stop] extracts characters from start (inclusive) to stop (exclusive). For the string "Programming is fun!", to get 'gra', the start index should be 3 (since indexing starts at 0, 'P' is 0, 'r' is 1, 'o' is 2, 'g' is 3) and the stop index should be 6 to include 'g', 'r', 'a' but not the next character.
Snap & solve any problem in the app
Get step-by-step solutions on Sovi AI
Photo-based solutions with guided steps
Explore more problems and detailed explanations
D. sentence[3:6]