+ 1

Question With Python Control Structures Module 2 Quiz

I Am Not Able To Understand How This Code: What is the output of this code? list = [1, 1, 2, 3, 5, 8, 13] print(list[list[4]]) Results To 8?

23rd Aug 2019, 8:19 PM
Soumyavardhan
Soumyavardhan - avatar
1 Odpowiedź
0
list[4] gives the value 5, since the index starts from 0. Now, list[list[4]] equates to list[5], which in turn is 8.
14th Jun 2022, 12:55 PM
Pardha Saradhy
Pardha Saradhy - avatar