title: Python 3 variable reference in a string used for a PUT request
body: <p>How do I reference python variables within a Rest API (payload) string? I can't get my script to recognize the value of the variables. For example:</p>
  
  <pre><code>import requests
  
  var1 = "testId"
  var2 = "testName"
  var3 = "testUsername"
  payload = "Id=var1&amp;Name=var2&amp;Username=var3"
  
  
  # Desired output 
  print(payload)
  &gt;&gt;&gt; Id=testId&amp;Name=testName&amp;Username=testUsername
  
  # My output
  print(payload)
  &gt;&gt;&gt; Id=var1&amp;Name=var2&amp;Username=var3
  </code></pre>
  
  <p>Based on the example above, the python script should get the values for var1, var2, and var3 (as opposed to printing the var string). Oddly enough I don't receive any error messages.</p>