title: How to create a dictionary from a list with a list of keys only and key-value pairs (Python)?
body: <p>This is an extension of this question: <a href="https://stackoverflow.com/questions/12739911/how-to-separate-string-and-create-a-key-value-pairs-python">How to split a string within a list to create key-value pairs in Python</a></p>
  
  <p>The difference from the above question is the items in my list are not all key-value pairs; some items need to be assigned a value.</p>
  
  <p>I have a list:</p>
  
  <pre><code>list = ['abc=ddd', 'ef', 'ghj', 'jkl=yui', 'rty']
  </code></pre>
  
  <p>I would like to create a dictionary:</p>
  
  <pre><code>dict = { 'abc':'ddd', 'ef':1, 'ghj':1, 'jkl':'yui', 'rty':1 }
  </code></pre>
  
  <p>I was thinking something along the lines of:    </p>
  
  <pre><code>a = {}
  for item in list:
     if '=' in item: 
       d = item.split('=')
       a.append(d) #I don't I can do this.
     else:
       a[item] = 1 #feel like I'm missing something here.
  </code></pre>