0

Explain please

x = {1:0,0:1} y=[1,[4,6,5,4],2] print(list(set(y[x[0]]))[0]) output - 5 how ?????...

31st May 2017, 9:19 AM
Aacharan Jain
Aacharan Jain - avatar
2 Answers
0
When converting from array or list to a set, you can no longer trust the index operator ( [ ] ), because in a set there is no concept of first or last element; so a random value of the set is returned.
31st May 2017, 9:44 AM
Madera Oxidada
Madera Oxidada - avatar
0
oke james but how
31st May 2017, 10:01 AM
Aacharan Jain
Aacharan Jain - avatar