+ 2

Why 1 is output?

m = [1,9,3,5,8,3,3,6,1,8] print(m[m[4]])

22nd Sep 2019, 4:11 AM
Navneet
Navneet - avatar
3 odpowiedzi
+ 2
m[4] == 8 so m[m[4]] == m[8] and m[8] == 1
22nd Sep 2019, 4:27 AM
你知道規則,我也是
你知道規則,我也是 - avatar
+ 1
m[4] is 8 So, m[m[4]] is m[8] and then m[8] is 1
22nd Sep 2019, 4:25 AM
Phurinat Puekkham
Phurinat Puekkham - avatar