title: How to use data from input as parameter referencing an existing object instance?
body: <p>This is my first ever stackoverflow post and I'm also a beginner coder, so please excuse any ignorance here. I've been racking my brain all day trying out figure out what I imagine is something simple. </p>
  
  <p>I am working on a small OOP based program to view and modify inventory. I am stuck at trying to take input from a user and applying it to a class method as the object parameter. </p>
  
  <p>Very simply put, this is what I am trying to do, but it is failing because the value from input is a <strong>string</strong> and the method expects an <strong>object name</strong>. </p>
  
  <pre><code>class_instance.class_method(input())
  </code></pre>
  
  <p>More in depth.. Here is the inventory class, and you can see that the <code>remove_product</code> method expects an object instance. </p>
  
  <pre><code>class Inventory(): 
  
  # Instantiate object and give functionality to printing object
  def __init__(self):
      self.inventory_summary = {}
      self.inventory_total = 0
      self.products = []
  
  # Remove product objects from inventory and adjust value    
  def remove_product(self,product):
      print("\n{} removed from inventory.".format(product.ID))
      self.products.remove(product.ID)
      self.inventory_total -= product.total_value
      del self.inventory_summary[product.ID]
      print("Current inventory of products: {}".format(self.products))
      print("Updated inventory total: ${}".format(self.inventory_total))
  </code></pre>
  
  <p>In my application, I have the product list displayed as a dictionary. When prompted to delete a product from the inventory, I would like the user to be able to type <code>product1</code> (variable name of instance of <strong>Product</strong> class) to pass <code>product1</code> to the inventory class to be removed. </p>
  
  <p>Is this possible (and efficient/practical/ethical)? TYIA to anyone willing to help. </p>