dic.values()
wraps all the values from different keys inside another list:
>>> dic.values()
[[[], [], [(3, 2, 0)], [(3, 1, 0)], [], [], [(4, 3, 2), (4, 3, 0)], [(4, 2, 0)]]]
Since, you have only one key there is only one element in dic.values()
and when you do x = list(map(len, dic.values()))
you get 8
because that's the length on the inner list.
You need to iterate over the inner list dic.values()[0]
and get the length from there:
>>> sum(map(len, dic.values()[0]))
5
UPDATE: If you are using python 3, you can get the first value as list(dic.values())[0]
:
>>> sum(map(len, list(dic.values())[0]))
5
This SO Post list many ways you can get the first value.