title: how to assign keys and values to a dictionary using loops in python?
body: <p>MY CODE: </p>
  
  <pre><code>a = ['name1 2 3 4', 'name2 5 6 7']
  dicto = {}
  i = 0
  while (i &lt; 2):
      dicto[a[i][:(a[i].find(''))]] = a[i][a[i].find('') + 1:]
      i += 1
  print(dicto)
  </code></pre>
  
  <p>DESIRED OUTPUT:</p>
  
  <pre><code>{'name1':'2 3 4','name2':'5,6,7'}
  </code></pre>
  
  <p>MY OUTPUT:</p>
  
  <pre><code>{'': 'ame2 5 6 7'}
  </code></pre>