+ 1

hello every one, please can you explain this outputs?

list=[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 ] print(list[list[4]]) output=6 print(list[list[6]]) output=8 print(list[list[8]]) output=10

7th Sep 2022, 8:07 AM
Ravi Madushanka
2 Antworten
+ 4
list=[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 ] print(list[list[4]]) => list[4] = 5 then list[5] is 6 so output=6 print(list[list[6]]) => list[6] = 7 and list[7] is 8 so it output=8 print(list[list[8]]) => list[ list[8] ] => list[ 9 ] = 10 so it outputs 10
7th Sep 2022, 8:49 AM
Jayakrishna 🇮🇳
+ 2
Thanks,🙏
7th Sep 2022, 9:08 AM
Ravi Madushanka