- 1
Module 2 Quiz
Why is the answer to the following code 8 and not 5? list = [1, 1, 2, 3, 5, 8, 13] print(list[list[4]])
1 ответ
+ 6
Look, do you know what does list[number] do? It returns the list item indexing 'number'!
So, list[4] means the 5th item of the list or which index is 4. And it is 5
Now you get, print(list[list[4]]) → print(list[5])
list[5] refers to the 6th item of the list which is 8!
So you get 8 as the output.