0
List/ Index- Why is this answer 8 and not 5, I'm new please explain.
What is the output of this code? list = [1, 1, 2, 3, 5, 8, 13] print(list[list[4]])
2 odpowiedzi
+ 5
Evaluate from inside -> list[4] first and list[list[4]] next.
list[4] = 5 meaning list[list[4]] = list[5] = 8.
+ 1
list[list[4]]
list[4] = 5
list[5] = 8