+ 2
Python: nested list and *operator with lists.
Can anyone explain why the output of this code is 9 ? x=[0,[2,4,6],[13,11,9]] y=x[2]+x[1]*2 print(y[x[1][0]])
1 Answer
+ 2
x[1][0]=2
y[2]=9 because y starts with 13, 11, 9...
Can anyone explain why the output of this code is 9 ? x=[0,[2,4,6],[13,11,9]] y=x[2]+x[1]*2 print(y[x[1][0]])