0
List function. Why is the answer 8?
list = [1, 1, 2, 3, 5, 8, 13] print(list[list[4]]) Question from one of the tutorials of python If you were to only use the list function once it would give the answer as 5. I don't understand why when you use the list function twice as in this instance the answer is 8. Can someone please explain it to me. Also why would you use the list function twice in the first place. what is the process that is happening here?
1 Resposta
+ 1
You unpack it from the right so:
list[list[4]] > list[5] > 8