title: Can two strings arguments be passed to a python dict() built in function?
body: <p>I have a loop i would like to build a dictionary from.  The part of the code I'm having trouble with is that both the key and the value are strings.  I cannot convert the IP variable back string into a int nor is it a float.</p>
  
  <p>Here is the method from my class I'm attempting to build the dictionary with.  There is a loop elsewhere walking the IP range I'm interested in feeding the method parameter 'ip'.</p>
  
  <pre><code>def dictbuild(self,ip):
      s = pxssh.pxssh()
      s.force_password = True
      try:
          s.login(str(ip), 'root', 'password')
          s.sendline('hostname')   # run a command
          s.prompt()             # match the prompt
          out = s.before        # print everything before the prompt, this returns a byte object and could need decode(utf-8)
          out = out.decode('utf-8')
          out = out.split()
          out = out[1]
          print(type(out)) #These type function give us an easy output of data types in the traceback
          print(type(ip))
  
          ipdict = dict(out=ip) ###Getting stuck here on two string types.
          print(ipdict)
          s.logout()
      except (pxssh.ExceptionPxssh, pexpect.EOF) as e:
          pass
  </code></pre>
  
  <p>Instead of passing the string i want (it would actually be the hostname of the box) we get an output like this...</p>
  
  <pre><code>&lt;class 'str'&gt;
  &lt;class 'str'&gt;
  {'out': '10.20.234.3'}
  </code></pre>
  
  <p>The python documentation only gives examples of key as string and value as int.  Am i using this wrong?</p>
  
  <p><a href="https://docs.python.org/2/tutorial/datastructures.html" rel="nofollow">https://docs.python.org/2/tutorial/datastructures.html</a></p>
  
  <p>Thanks in advance.</p>