title: TypeError: can only concatenate tuple (not "int") to tuple
body: <pre><code>urllist = ['http://example.com',
             'http://example1.com']
  i = 0
  while i &lt; len(urllist):
      source = urllib.urlopen(urllist[i]).read()
      regex = '(\d{3})/"&gt;(\w+\s-\s\w+)&lt;/a&gt;'  # e.g. '435', 'Tom-Jerry' 
      p = re.compile(regex)
      db = re.findall(p, source)
      db = [tuple(filter(None, t)) for t in db]   
  
      hero_id = []
      for i in db:
          hero_id.append(i[0])
  
      i += 1
  print hero_id
  </code></pre>
  
  <p><code>db = [tuple(filter(None, t)) for t in db]</code>  <code>db</code> is a list of tuples like this: <code>[('564', 'Tom', 'Jerry'), ('321', 'X-man', 'Hulk')]</code></p>
  
  <p>The logic behind this should be the following: Start off with the <code>urllist[0]</code>, search for the regex, collect the <code>db</code>, for every tuple in <code>db</code>, take the <code>[0]</code> element from the tuple (the number) and append it to the <code>hero_id</code> list. While you're done, add 1 to <code>i</code> and repeat the whole process for the next url from <code>urllist</code> while there is none left.</p>
  
  <p>When I run this code, I get this:</p>
  
  <p><code>i += 1
  TypeError: can only concatenate tuple (not "int") to tuple</code></p>
  
  <p><code>i += 1</code> in the code is outside the for loop so this exception surprises me a little bit. Ideas?</p>