title: Python: referencing class object list of lists
body: <p>I am fairly new to python. I have tried to define a class, I then want to create an instance from a file, then refer to specific pieces of it, but cannot seem to. This is Python 3.3.0</p>
  
  <p>Here's the class....</p>
  
  <pre><code>class Teams():
  
      def __init__(self, ID = None, Team = None, R = None, W = None, L = None):
          self._items = [ [] for i in range(5) ]
          self.Count = 0
  
  
      def addTeam(self, ID, Team, R=None, W = 0, L = 0):
          self._items[0].append(ID)
          self._items[1].append(Team)
          self._items[2].append(R)
          self._items[3].append(W)
          self._items[4].append(L)
          self.Count += 1
  
      def addTeamsFromFile(self, filename):
          inputFile = open(filename, 'r')
          for line in inputFile:
              words = line.split(',')
              self.addTeam(words[0], words[1], words[2], words[3], words[4])
  
      def __len__(self):
          return self.Count
  </code></pre>
  
  <p>Here's the code in Main</p>
  
  <pre><code>startFileName = 'file_test.txt'
  filename = startFileName
  
  ###########
  myTestData = Teams()
  
  myTestData.addTeamsFromFile(startFileName)
  </code></pre>
  
  <p>sample data in file</p>
  
  <pre><code>100,AAAA,106,5,0
  200,BBBB,88,3,2
  300,CCCC,45,1,4
  400,DDDD,67,3,2
  500,EEEE,90,4,1
  </code></pre>
  
  <p>I think I am good to here (not 100% sure), but now how do I reference this data to see... am i not creating the class correctly? How do I see if one instance is larger than another...</p>
  
  <p>ie, <code>myTestData[2][2] &gt; myTestData[3][2]</code> &lt;----- this is where I get confused, as this doesn't work</p>