0

I don't what the code mean

Yea i don't understand this code why i get 8 list = [1, 1, 2, 3, 5, 8, 13] print(list[list[4]])

8th Jun 2022, 1:17 PM
Alvin Phyo Htet
Alvin Phyo Htet - avatar
2 Réponses
+ 4
list[4] is 5 list[5] is 8
8th Jun 2022, 1:24 PM
Lisa
Lisa - avatar
0
the array start form index 0 list [0] = 1 list [1] = 1 list [2] = 2 list [3] = 3 list [4] = 5 list [5] = 8 list [6] = 13 list[list[4]] we have index 4 = 5 list[5] we have index 5 = 8 the output is 8
8th Jun 2022, 5:41 PM
ZAKI MAX
ZAKI MAX - avatar