+ 1
Python Double List[solved]
what does it mean to have print(list[list[x]])
3 Réponses
+ 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.
+ 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.
+ 1
Thank you!