title: TypeError: unsupported operand type(s) for +=: 'int' and 'list'
body: <p>I am trying to do a project in python. I'm getting an error in the line</p>
  <blockquote>
  <p><code>s+=line</code></p>
  <p><code>TypeError: unsupported operand type(s) for +=: 'int' and 'list'</code></p>
  </blockquote>
  <p>Here is the function called <code>testIfCorrect</code>:</p>
  <pre><code>def testIfCorrect(world, x, y):
      s=0
      for line in world:
          s+=line
          print(&quot;ligne&quot;,line)
          if(s &gt; 2):
              return False
      for i in range(x):
          if(sum(returnColumn(world, i)) &gt; 2):
              return False
      for j in range(x):
          for k in range(y):
              if(j == k):
                  pass
              else:
                  if(world[j] == world[k]):
                      return False
                  if(returnColumn(world, j) == returnColumn(world ,k)):
                      return False
  
  def returnColumn(array, column):
      return [col[column] for col in array]
  </code></pre>
  <p>Where is the error?</p>