title: python reading wrong type
body: <p>I have a text file that contains lines of numbers. My program is trying to extract the lines of code and put them in a list, with each list being composed of the numbers that make up that line in the file, and then put all of these lists into one list <em>(lets call this Triangle)</em> and have a function applied to them, but the Python interpreter says that <code>Triangle[x]</code> is an integer type when I am trying to work with it, but when I ask it <code>type(Triangle[x]</code>), it says that it is a list.  My code is below:</p>
  
  <pre><code>def compare(a,b):
  """Returns the larger of a and b"""
  if a &gt; b:
      return a
  else:
      return b
  
  doc = open('C:/Users/Joseph/My Documents/Programming fun/Python/Project Euler/18triangle.txt')
  
  Triangle = []
  
  for line in doc:
      Triangle.append( map( int, line.split() ) )
  
  doc.close()
  
  Triangle.reverse()
  
  for i in xrange(len(Triangle) - 1):
      for j in xrange(len(Triangle[i]) - 1):              # Here it says that 'type int has no len'
          TEMP = compare(Triangle[i][j],Triangle[i][j + 1])
          Triangle[i+1] = TEMP
  </code></pre>
  
  <p>Thank you in advance for any advice you can offer.</p>