title: Python List of different class' objects
body: <p>Hello I have declared a class in Python and then I want to make a list of objects of this class and print it. I am new to python and I cannot figure out what I am doing wrong. I know C++ and this is what I would like to do</p>
  
  <pre><code>class Word:
  
      def __init__(self,word,hor):
          self.word=word
          self.x1=0
          self.y1=0
          self.x2=0
          self.y2=0
          self.hor=hor
  
      def get_dimensions(self):
          return(self.x1,self.y1,self.x2,self.y2)
  
      def set_dimensions(self,t):
          self.x1=t[0]
          self.y1=t[1]
          self.x2=t[2]
          self.y2=t[3]
  
      def get_horizontal():
          return self.hor
  
      def display(self):
          print word
  
  def WordList(word_list,hor):
      l=[]
      for x in word_list:
          w1=Word(x,hor)
          l.append(w1)
      return l
  
  
  li=["123","23","43"]
  li=WordList(li,True)
  for x in li:
      x.display #obviously something else has to be done here
  </code></pre>
  
  <p>Also I get the following compilation problem when I try to run it:</p>
  
  <pre><code>[&lt;__main__.Word instance at 0x7ffc9320aa70&gt;, &lt;__main__.Word instance at 0x7ffc9320ab00&gt;, &lt;__main__.Word instance at 0x7ffc9320ab48&gt;]
  </code></pre>
  
  <p>Can you help me?</p>