title: python not allowing same value in list
body: <p>i've a python script to parse a grammar. initial code is:</p>
  
  <pre><code>num_pro=int(raw_input())
  
  right=[];left=[];
  
  for i in range(num_pro):
    map(list.append, (left, right), raw_input().split('-&gt;'))
  
  right_edit=[];left_edit=[];i=0
  
  for rhs in right:
    parts=rhs.split('|')
    for each in parts:
      left_edit.append(left[i])
      right_edit.append(each)
    i+=1
  
  for each in right_edit:
    print left_edit[right_edit.index(each)]+" -&gt; "+each
  </code></pre>
  
  <p>i'm taking input from a file which contains:</p>
  
  <pre><code>6
  E-&gt;TZ
  Z-&gt;+TZ|e
  T-&gt;FY
  Y-&gt;*FY|e
  F-&gt;(E)|a
  X-&gt;*ZX|e
  </code></pre>
  
  <p>the output comes as:</p>
  
  <pre><code>E -&gt; TZ
  Z -&gt; +TZ
  Z -&gt; e
  T -&gt; FY
  Y -&gt; *FY
  Z -&gt; e    #unexpected
  F -&gt; (E)
  F -&gt; a
  X -&gt; *ZX
  Z -&gt; e    #unexpected
  </code></pre>
  
  <p>while the expected output is:</p>
  
  <pre><code>E -&gt; TZ
  Z -&gt; +TZ
  Z -&gt; e
  T -&gt; FY
  Y -&gt; *FY
  Y -&gt; e    #expected
  F -&gt; (E)
  F -&gt; a
  X -&gt; *ZX
  X -&gt; e    #expected
  </code></pre>
  
  <p>i've searched and found that with dictionaries same key is not allowed and in set also same values are not allowed. in my code i'm not using dictionaries or sets. also i'm not using <code>list.index(value)</code>. still why such output is coming. how to get the expected output.</p>