title: Access a class object from its proprieties
body: <p>i was writing a function A that gives you person behavior in school and i wanted to rank it but i can't link the function A and the class &quot;person&quot; , i need a way to create an object from that class and give it a propriety &quot;Name&quot; based on the function A output and then access the object by the same &quot;Name&quot; propriety</p>
  <pre><code>class person:
      def __init__(self, name):
          self.name = name
          self.credits = 0
  
      def credits_add(self, amount):
          self.credits += amount
  
  def who_tried():
      #########
      ################
      #########################
      return name # Ex : &quot;jack&quot;
  
  if who_tried():
      (who_tried()).credits_add(10)
  </code></pre>
  <p>and also i need a way to check if object exists by its propriety &quot;Name&quot;</p>