title: How to Concatenate an Index in a String to Another String in Python
body: <p>I have a string of length for example 20</p>
  
  <p>I want to go in a loop to concatenate a the last 6 characters in the string </p>
  
  <p>I'm doing it like this:</p>
  
  <pre><code>leng = len(theString)
  
  leng2 = leng -6
  
  for i in range(leng2, leng)
  
        a += theString.index(i)
  
  print a
  </code></pre>
  
  <p>But i'm getting an error in " a += theString.index(i) "</p>
  
  <p>stating "TypeError: expected a character buffer object"</p>