Python List slice | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
0

Python List slice

Could anyone please kindly explain why this output is 8? list = [1, 1, 2, 3, 5, 8, 13] Print(list[list[4]])

5th Sep 2021, 2:03 PM
YokoS
2 Réponses
+ 5
easy!!! decompose in parts!! list[4] prints 5 list[5] prints 8
5th Sep 2021, 2:05 PM
David Ordás
David Ordás - avatar
0
Thank you for the explanation. I understand :)
5th Sep 2021, 2:40 PM
YokoS