i dont understund this code | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

i dont understund this code

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

11th May 2019, 4:06 PM
aziz
4 Answers
+ 14
list[4] will be 5 So, list[list[4]] = list[5] And list[5] = 8 So, print(list[list[4]]) = 8
11th May 2019, 4:10 PM
VEDANG
VEDANG - avatar
+ 6
list[4]=5 list[5]=8 So list[list[4]]=8
11th May 2019, 4:39 PM
Basel.Al_hajeri?.MBH()
Basel.Al_hajeri?.MBH() - avatar
+ 3
Yes VEDANG bro
11th May 2019, 4:40 PM
Basel.Al_hajeri?.MBH()
Basel.Al_hajeri?.MBH() - avatar
+ 2
It is inner indexing, which returns a value for outer indexing.
11th May 2019, 6:19 PM
Seb TheS
Seb TheS - avatar