+ 2
I have a question in python
what would be the answer to this code list = [1,1,2,3,5,8,13] print(list[list[4]]) and why is that the answer, thenks
5 odpowiedzi
+ 2
The answer would be 8.
That is because the computer first evaluates list[4] which is 5 (because indexing starts at 0).
Then it would evaluate list[5] which is 8.
list[list[4]] = list[5] = 8
You could run it at Code Playground to test it, though.
Good luck with implementing the Fibonacci sequence!
+ 12
list = [1,1,2,3,5,8,13]
index value start from 0 in list so
list[4]=5
so list[list[4]]=list[5]=8
so output will be 8
+ 1
list=[1,1,2,3,5,8,13]
print(list[list[4]])
it's output is 8
because let's take inner index i.e list[4] it's output is 5 now take outer one I.e list[5] whose output is 8
- 2
8
- 4
face command in Turkish if