title: Python: How to make the the value of a variable an object
body: <p>I am currently trying to create a program in python that randomly creates an object in a class when run. However, the problem I've run into is that when i attempt to create the object with code like this:</p>
  
  <pre><code>name = sword(name, rarity, dam)
  </code></pre>
  
  <p>I get an object with the reference being the variable name and not the actual name stored inside. How do create the object using the value inside the name variable as the reference?</p>