title: How to remove "u" in output. Error: AttributeError: 'dict' object has no attribute 'encode'
body: <p>I am trying to store JSON output in a variable. Initially I got the output but it was prepended with character "u" (unicode). Below is the initial output:</p>
  
  <pre><code>{u'imdata': [{u'nvoNws': {u'attributes': {u'dn': u'sys/epId-1/nws', u'status': u'', u'persistentOnReload': u'true', u'monPolDn': u'', u'modTs': u'2017-02-24T00:50:47.373+00:00', u'uid': u'0', u'childAction': u''}}}, {u'nvoPeers': {u'attributes': {u'dn': u'sys/epId-1/peers', u'status': u'', u'persistentOnReload': u'true', u'monPolDn': u'', u'modTs': u'2017-02-24T00:50:47.373+00:00', u'uid': u'0', u'childAction': u''}}}, {u'nvoEp': {u'attributes': {u'status': u'', u'operState': u'down', u'persistentOnReload': u'true', u'propFaultBitmap': u'', u'hostReach': u'0', u'adminSt': u'disabled', u'holdUpTime': u'0', u'encapType': u'0', u'uid': u'0', u'epId': u'1', u'sourceInterface': u'unspecified', u'descr': u'', u'monPolDn': u'uni/fabric/monfab-default', u'modTs': u'2017-02-24T00:50:47.373+00:00', u'holdDownTimerExpiryTime': u'NA', u'autoRemapReplicationServers': u'no', u'operEncapType': u'0', u'dn': u'sys/epId-1', u'mac': u'00:00:00:00:00:00', u'cfgSrc': u'0', u'childAction': u'', u'vpcVIPNotified': u'no', u'learningMode': u'0', u'controllerId': u'0', u'holdUpTimerExpiryTime': u'NA', u'holdDownTime': u'180'}, u'children': [{u'nvoPeers': {u'attributes': {u'status': u'', u'persistentOnReload': u'true', u'monPolDn': u'', u'modTs': u'2017-02-24T00:50:47.373+00:00', u'uid': u'0', u'rn': u'peers', u'childAction': u''}}}, {u'nvoNws': {u'attributes': {u'status': u'', u'persistentOnReload': u'true', u'monPolDn': u'', u'modTs': u'2017-02-24T00:50:47.373+00:00', u'uid': u'0', u'rn': u'nws', u'childAction': u''}}}]}}], u'totalCount': u'3'}
  </code></pre>
  
  <p>So then I added <code>encode('utf-8')</code> to my print output statement and after that I got below error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "/Users/shandeep/Desktop/n9k-rest/Andys_payloads/Andys_script.py", line 548, in &lt;module&gt;
      get_interface_nve()
    File "/Users/shandeep/Desktop/n9k-rest/Andys_payloads/Andys_script.py", line 113, in get_interface_nve
      print(x.encode('utf-8'))
    AttributeError: 'dict' object has no attribute 'encode'
  </code></pre>
  
  <p>Below is definition and function call.</p>
  
  <pre><code>def request_get(dn):
      cookie = login_api()
      response = requests.get(url + dn + '?query-target=subtree&amp;rsp-subtree=full', cookies=cookie, verify=False)
      print('Valid response: \n' + response.text)
      return response.json()
  
  def get_interface_nve():
      x = request_get('/api/mo/sys/epId-1.json')
      print('PRINT OUTPUT: \n')
      #print(x)
      print(x.encode('utf-8'))
  </code></pre>
  
  <p>Function call:</p>
  
  <pre><code>get_interface_nve()
  </code></pre>