title: TypeError: cannot concatenate 'str' and 'builtin_function_or_method' objects in python
body: <p>Please I am beginner in python coding.This is my code and am not able to resolve the error . Can some one suggest me what is the prob in code actually. thanks in advance.</p>
  
  <pre><code>import urllib2
  username = '&lt;YOUR USERNAME&gt;'
  password = '&lt;YOUR PASSWORD&gt;'
  format = 'json' # json or xml
  filename = 'archive.json' # filename of the archive
  tweets = 164 # number of tweets
  pages = (int(float(tweets)/float(80)))+1
  auth = urllib2.HTTPPasswordMgrWithDefaultRealm()
  auth.add_password(None, 'http://twitter.com/account/', username, password)
  authHandler = urllib2.HTTPBasicAuthHandler(auth)
  opener = urllib2.build_opener(authHandler)
  urllib2.install_opener(opener) 
  i = 1
  response = ''
  print 'Downloading tweets. Note that this may take some time'
  while i &lt;= pages:
      request = urllib2.Request('http://twitter.com/statuses/user_timeline/account.' \
      + format + '?page=' + str(i))
      response = response + urllib2.urlopen(request).read()
      i = i + 1
  handle = open(filename,"w")
  handle.write(response)
  handle.close()
  print 'Archived ' + str(tweets) + ' of ' + username + \
  '\'s tweets to ' + filename
  </code></pre>
  
  <p>ERROR is like this below:</p>
  
  <pre><code>**Traceback (most recent call last):
    File "&lt;pyshell#14&gt;", line 3, in &lt;module&gt;
      + format + '?page=' + str(i))
  TypeError: cannot concatenate 'str' and 'builtin_function_or_method' objects**
  </code></pre>