What is L [L [3]] in the list?

I am currently studying the finale of computer science, and I do not understand how this works at all:

L = [8, 6, 7, 5, 3, 0, 9]

30. L [L [3]] - 1 is?
(A) * -1
(B) an error
(C) 8
(D) 4
(E) 7

Answer: -1 .. SO, to check how this works, I just did L [L [3]] and the answer is 0, then I did L [L [4]], and thar is 5, then I did L [L [1]], which gave 9, but if I go L [L [2]], I get an index index out of range. Im out of confusion here. Anyone can help please?

+3
source share
7 answers

L[3]is 5, L[L[3]]is L[5]is 0, and 0 - 1- -1.

+11
source

These problems work best in one moment, from within.

, L [3] 5. (5) , L [5], 0. , 0 - 1 = -1, .

+4

(, f (g (x))).

, L[L[3]] -> L[5] -> 0 , -1.

, L[L[1]] = L[6] -> 9. , L[L[2]] = L[7] -> IndexError.

( , ) .

+2

, , :

L[3] 5, L[L[3]] L[5] = 0 L[L[3]] -1 = 0-1 = -1

0

L [2] = 7, 7 , 0..6. L [L [2]] = L [7] ...

0

l [3], 5, , l [5], 0, 1... ta dah!

0

Here is the answer broken down in steps:

L = [8, 6, 7, 5, 3, 0, 9]

L [L [3]] - 1 = -1

L [3] = 5, therefore L [L [3]] = L [5] = 0

0
source

All Articles