whats the logic of this code? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

whats the logic of this code?

What is the output of this code? list = [1, 1, 2, 3, 5, 8, 13] print(list[list[4]])

25th Oct 2019, 12:08 PM
yash ambekar
yash ambekar - avatar
1 Answer
+ 5
you're using the value at position 4 to get the value from another position in the same list...the answer in this case would be 8
25th Oct 2019, 12:15 PM
George Samanlian