+ 1
list = [1, 1, 2, 3, 5, 8, 13] print(list[list[4]])
This list[4] within the print(list) makes the fourth value get skipped and you end up printing the fifth placeholder. The answer is 8
3 Respostas
+ 3
list[4] evaluates to 5. So, list[list[4]] is the same as list[5] which evaluates to 8
+ 1
hmm , i see a downvote in both AJ sir's and ChaoticDawgs Answers ... 👀
0
Tom Clark
To understand this type of problem you can you can divide your program in small pieces like
list[list [4]]
You can store list[4] in another variable
b = list[4] so now your code will look like
list[b]
Now b is 5 so list [5] will be 8