+ 1

Python Double List[solved]

what does it mean to have print(list[list[x]])

12th Mar 2018, 4:38 PM
Martin Brock
Martin Brock - avatar
3 odpowiedzi
+ 2
list = [1,2,5,6,7,8,9,10,13,15] print(list[list[6]]) #list[6]=9 print(list[9]) #list[9]=15 15 actually interpreter will directly show 15 as result, but steps in the example are shown for your understanding.
12th Mar 2018, 5:09 PM
📈SmileGoodHope📈
📈SmileGoodHope📈 - avatar
+ 1
first determine the value of list[x], suppose it's value is "a" , the function is now print((list[a]),then the value of list[a] determines and it is the output.
12th Mar 2018, 4:57 PM
⭐GameBoy⭐
⭐GameBoy⭐ - avatar
+ 1
Thank you!
26th Mar 2018, 4:19 PM
Martin Brock
Martin Brock - avatar