<br><br><div class="gmail_quote">On Fri, Oct 9, 2009 at 10:02 AM, Victor Subervi <span dir="ltr"><<a href="mailto:victorsubervi@gmail.com">victorsubervi@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Hi;<br>I have the following code:<br><br>    elif table[0] == 't': # This is a store subtype table<br>      bits = string.split(table, '0')<br>      sst.append(bits[2])<br>      sstp.append(bits[1])<br>  subtypes = dict(zip(sstp, sst))<br>


<br>When I print these out to screen, I get this:<br><br>sst: ['doctors', 'patient']
<br>
sstp: ['prescriptions', 'prescriptions']
<br>
subtypes: {'prescriptions': 'patient'}

<input name="bst" value="[" type="hidden">
<input name="sst" value="[" type="hidden">
<input name="sstp" value="[" type="hidden">


  
    
<br><br>Why do I only get one item from sst and sstp zipped? Why not both??</blockquote><div>I think you have a logic problem that's not shown in that code sample:</div><div><br></div><div><div>>>> sst = ['doctors', 'patient']</div>

<div>>>> sstp = ['prescriptions', 'prescriptions']</div><div>>>> zip(sst,sstp)</div><div>[('doctors', 'prescriptions'), ('patient', 'prescriptions')]</div>

<div>>>> dict(zip(sst,sstp))</div><div>{'patient': 'prescriptions', 'doctors': 'prescriptions'}</div><div>>>> </div><div><br></div><div>--S</div></div></div>