+ 1

Confusion with lists.

Output needed for this question. a=[5,4,3,2] a[3]=1 a[a[3]]=6 print(a[1]%4)

29th Jan 2018, 6:12 PM
Amith Varma
Amith Varma - avatar
3 Answers
+ 3
a=[5,4,3,2] a[3]=1 -> a=[5,4,3,1] a[a[3]]=6 -> a[1]=6 -> a=[5,6,3,1] print(a[1]%4) -> 6%4=2
29th Jan 2018, 7:22 PM
Daniel
Daniel - avatar
+ 1
Wrong answer. Output : 2
29th Jan 2018, 6:19 PM
Amith Varma
Amith Varma - avatar
+ 1
How?
29th Jan 2018, 6:21 PM
Amith Varma
Amith Varma - avatar