QUESTION IMAGE
Question
what will you see on the next line?
>> alist = 9, 2, 3.5, 7
>> alist.index(3.5)
2
3
3.5
true
Step1: Recall list index rule
In Python, list indices start from 0.
Step2: Find index of element
For aList = [9, 2, 3.5, 7], the index of 3.5 is 2 since it is the third element and 3 - 1 = 2.
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
A. 2