title: How do you make a string converted to a variable name instantiated inside of a function global?
body: <p>Sorry for that confusing title, in my function my parameter is the name I want I want to set as a global variable name. I can do this outside of a function, and I can instantiate a global variable without a string as its name, and I haven't found any other articles with a solution to both problems at the same time.</p>
  
  <pre><code>def myFunc(varName):
      temp = varName
      # global vars()[temp]  &lt;== This line produces the error
      vars()[temp] = 5  # varName becomes a local variable
  </code></pre>