0

Please, I don't know how is this working ?

list = [1, 1, 2, 3, 5, 8, 13] print(list[list[4]])

8th May 2017, 2:08 PM
Hamada Hellal
Hamada Hellal - avatar
4 Réponses
+ 13
The answer is 8. list is an array and an array index starts from 0, So, list[4] has the value 5, and list[list[4]] means list[5] has the value 8. Therefore, answer is 8.
8th May 2017, 2:10 PM
Sachin Artani
Sachin Artani - avatar
+ 5
print(list[list[4]]) list[4]=5 print(list[5]) list[5]=8 print(8)
8th May 2017, 2:15 PM
Suyasa
Suyasa - avatar
+ 1
Please, how can I like a comment.
8th May 2017, 7:48 PM
Hamada Hellal
Hamada Hellal - avatar
+ 1
l got it.
8th May 2017, 7:50 PM
Hamada Hellal
Hamada Hellal - avatar