title: Pass string in JSON payload using python
body: <p>I want to pass a randomly generated password to my payload. This is what I have-</p>
  <pre><code>import requests
  import json
  import random
  import string
  
  #generate 12 character password
  alphabet = string.ascii_letters + string.digits + '!@#%^*()'
  newpassword = ''.join(random.choice(alphabet) for i in range(12))
  
  url = &quot;https://www.example.com&quot;
  payload = &quot;{\n    \&quot;id\&quot;: 123,\n    \&quot;name\&quot;: \&quot;John\&quot;,\n  \&quot;itemValue\&quot;: &quot;+newpassword+&quot; \n}&quot;
  headers = {
      'Content-Type': 'application/json',
  }
  response = requests.put(url, headers=headers, data=json.dumps(payload))
  print(response.text)
  </code></pre>
  <p>I'm not getting the desired output because it is not taking the new password string correctly.
  Please advise.</p>