list of lists

Sharan Basappa sharan.basappa at gmail.com
Sun Jul 22 07:47:33 EDT 2018


I am using a third party module that is returning list of lists.
I am using the example below to illustrate.

1 results = [['1', 0.99921393753233001]]
2 k = results[0]
3 print k[0]
4 print k[1]

Assume the line 1 is what is returned.
I am assigning that to another list (k on line 2) and then accessing the 1st and 2nd element in the list (line 3 and 4).

How can I access elements of 1 and 0.99 without assigning it to another list?



More information about the Python-list mailing list