list with xyz values to dictionary
<p>I have a list:</p>

<pre><code>list = [ '1', '1,'1', '-1','1','-1' ]
</code></pre>

<p>and need to convert it to a dictionary of dictionaries. The first three values in are x y z and the second set three values are x y z. The result should be: </p>

<pre><code>d = { 0:{x:1,y:1,z:1}, 1:{x:-1,y:1,z:-1}}
</code></pre>

<p>My attempt:</p>

<pre><code>mylist=[1,1,1,-1,1,-1]
count = 1
keycount = 0
l = {'x':' ','y':' ', 'z':' '}
t = {}
for one in mylist:
        if count == 1:
                l['x'] = one
                print l
        if count == 2:
                l['y'] = one
                print l
        if count == 3:
                l['z'] = one
                print l
                count = 0
                t[keycount] = l
                l = {}
                keycount += 1
        count = count + 1
print t
</code></pre>

<p>But in the result it switches some of the keys of the dictionary? Does anyone have a better solution?</p>
