Let u explain this answer in python? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Let u explain this answer in python?

abc=[1,3,5,6,2,7,4] Print (abc[abc[abc[4]]])

21st Aug 2020, 12:12 PM
Mkchowdary
Mkchowdary - avatar
6 Answers
+ 5
start from the inside and work your way out abc[abc[abc[4]]] abc[abc[2]] abc[5] 7
21st Aug 2020, 12:16 PM
Slick
Slick - avatar
+ 3
indexing starting from 0. we both just started on the inside, used indexing to find the value in the list repeatedly until it was just a value.
21st Aug 2020, 12:21 PM
Slick
Slick - avatar
+ 1
Kiibo has it explained better, look at his example. If we know the 0 index is the first value (abc[0] == 1 in your list), then you start on the innermost index (abc[4]), find the value, and keep doing this until you dont have to index the list again
21st Aug 2020, 2:05 PM
Slick
Slick - avatar
0
Intex starting from 0 then that value is 2.how to answer is 7🤔🤔
21st Aug 2020, 12:52 PM
Mkchowdary
Mkchowdary - avatar
0
I will explain abc=[1,3,5,6,2,7,4] Print (abc[abc[abc[4]]]) Print in tuple (abc):(1,3,5,6,2,7,4)-->this are the values of index 0-6. Inner list(3,5,6,2,7,4)-->then the index0-5 so finally list is[4]--->is the value is 7.
21st Aug 2020, 2:41 PM
Mkchowdary
Mkchowdary - avatar
- 1
Explain this answer
21st Aug 2020, 12:18 PM
Mkchowdary
Mkchowdary - avatar