title: Python - Call an object from a list of objects
body: <p>I have a class, and I would like to be able to create multiple objects of that class and place them in an array. I did it like so:</p>
  
  <pre><code>    rooms = []
      rooms.append(Object1())
      ...
      rooms.append(Object4())
  </code></pre>
  
  <p>I then have a dict of functions, and I would like to pass the object to the function. However, I'm encountering some problems..For example, I have a dict:</p>
  
  <pre><code>    dict = {'look': CallLook(rooms[i])}
  </code></pre>
  
  <p>I'm able to pass it into the function, however; in the function if I try to call an objects method it gives me problems</p>
  
  <pre><code>    def CallLook(current_room)
         current_room.examine()
  </code></pre>
  
  <p>I'm sure that there has to be a better way to do what I'm trying to do, but I'm new to Python and I haven't seen a clean example on how to do this. Anyone have a good way to implement a list of objects to be passed into functions? All of the objects contain the examine method, but they are objects of different classes. (I'm sorry I didn't say so earlier)</p>
  
  <p>The specific error states: TypeError: 'NoneType' object is not callable</p>