accessing lists values of dictionary
<p>I created a dictionary of lists using:</p>

<pre><code>names = defaultdict(list)
</code></pre>

<p>I am reading a line from the text file, splitting it into 3 columns. I am making the first column of the line as key and other two columns as the values in a list. I used the following code segment as following:</p>

<pre><code>with open('f.txt') as f:
    lines = [l.split() for l in f.readlines() if l.strip()]
    for l in lines:
            names[l[0]].append([l[1],l[2]])
</code></pre>

<p>I have the text files like this:</p>

<pre><code>00:12:34:23:45:67       134     123.456

45:34:23:45:44:23       133     345.123

3f:32:dr:45:34:r5       133     212.345

00:12:34:23:45:67       134     555.555

00:12:34:23:45:67       136     555.556

00:12:34:23:45:67       134     555.560
</code></pre>

<p>If i run my program to output key:value pairs, the output is:</p>

<pre><code>00:12:34:23:45:67 [['134', '123.456'], ['134', '555.555'], ['136', '555.556'], ['134', '555.560']]

45:34:23:45:44:23 [['133', '345.123']]

3f:32:dr:45:34:r5 [['133', '212.345']]
</code></pre>

<p>How can I access the individual elements of the list? For example, in this output, I want to count number of 133, 134, 135, 136 of each key and the time difference between each type. For example, for the key <code>00:12:34:23:45:67</code>, there are 3 134's, 1 136. The time difference between highest of and lowest of 134's for that key is 555.560-123.456. I want this result for all 133,134,135,136 types. I am struggling for this problem from many days. please help. Much appreciated.</p>
