0
quiz 2
list = [1, 1, 2, 3, 5, 8, 13] print(list[list[4]]) answer is 8 but i think it is 5 not sure whats wrong with what im doing
7 Réponses
0
The answer is 8. Don't forget list begin at index 0...
So here:
list[4]=5
list[5]=8
0
its [4] though not [5]
0
list[0]=1
list[1]=1
list[2]=2
list[3]=3
list[4]=5
0
think i need to spend more time on the lessons before the quiz cause im not sure
list = [1, 1, 2, 3, 5, 8, 13]
print(list[list[4]])
thats the question right so
list = [1, 1, 2, 3, 5, 8, 13]
0 1 2 3 4 5 6
print(list[list[4]])
so doing that it should be 5 for the answer but the quiz said wrong
i put the question in playground and it tells me 8 is the answer i must be missing something
0
what ever im doing wrong i just dont c it i'll go back and do the lessons before maybe ill figure it out
0
First, you take the value of the 4th index of the list (=5)
list[4]=5
Then, you take the value of the 5th index of the list (=8)
list[list[4]]= list[5]=8
Resume:
You take the value of the value of the 4th index!
0
o ok cool ty