list=[1,1,2,3,4,5,6,7] print(list[list[4]]) | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

list=[1,1,2,3,4,5,6,7] print(list[list[4]])

Output along with explanation please 🙏

19th Jun 2020, 11:03 AM
Saumitra
Saumitra - avatar
3 Answers
+ 1
Try answering these questions. 1. What is list[4]? 2. Which type is list[4]? 3. Can I put complex expressions inside array indexing? Once answered, you may gain some more insight of what follows.
19th Jun 2020, 11:07 AM
Felipe BF
+ 1
yes now i understood...thanks a lot 𝐊𝐢𝐢𝐛𝐨 𝐆𝐡𝐚𝐲𝐚𝐥 🙂🙂🙂🙂
19th Jun 2020, 12:09 PM
Saumitra
Saumitra - avatar
0
list=[1,1,2,3,5,8,13] print(list[list[4]]) i got 8 as an output here...why not 5???
19th Jun 2020, 11:28 AM
Saumitra
Saumitra - avatar