title: Accessing a class instance's attributes using user input
body: <p>So I have this code:</p>
  
  <pre><code>class vehicle(object):
      def __init__(self):
          self.age = 6
          self.make = 8
          self.colour = 'colour'
          self.cost = 'cost'
  
  class car(vehicle):
      def __init__(self):
          vehicle.__init__(self)
          self.type = 'car'
  
  car1 = car()
  print car1.make, car1.colour, car1.cost, car1.type, car1.age
  
  n = raw_input()
  dic = {'name' : n}
  dic['name'] = car()
  print dic['name'].make
  </code></pre>
  
  <p>In the last bit, I was able to resolve a previous issue I had: Creating an instance of the car class with its name being one that the user inputs in n</p>
  
  <p>Now, say I wanna ask the user to input a name and now I have to find the class' instance that has that name. </p>
  
  <p>For example if at one point an instance with the name car2 was created. Now user wants to get info about car2 and inputs 'car2'. how can I use this input to access attributes of the instance called car2?</p>
  
  <p>I tried:</p>
  
  <pre><code>a = raw_input()
  dic['fetch'] = a
  dic['fetch'].make
  </code></pre>
  
  <p>does not work.</p>