title: Add and increment number to the end of numerical or non-numerical string python
body: <p>I am reading a JSON file with data in it and I am trying to ensure that each file that is created in my code has a unique value. However sometimes the value is a string either like "data" or some number as a string</p>
  
  <p>So if the file I are creating 3 times is called "data", I want to convert it into:</p>
  
  <pre><code>data_0
  data_1
  data_2
  </code></pre>
  
  <p>Also if the value is the a number (but it string format) such as 145 I want to change that to:</p>
  
  <pre><code>145
  146
  147 
  </code></pre>
  
  <p>Currently my code produces something like this:</p>
  
  <pre><code>data_0, 
  data_0_1, 
  data_0_1_2
  </code></pre>
  
  <p>or </p>
  
  <pre><code>145_0, 
  145_0_1, 
  145_0_1_2
  </code></pre>
  
  <p>Below is my code:</p>
  
  <pre><code>for index in range(0,len(test)):
        test[index]["value"]= test[index]["value"] + str(number)
  </code></pre>
  
  <p>I am using <code>str(number)</code> because otherwise I get this error:</p>
  
  <blockquote>
    <p>TypeError: coercing to Unicode: need string or buffer, int found</p>
  </blockquote>
  
  <p>JSON file example:</p>
  
  <pre><code>"test": [{
      "type": "text",
      "value": "data"
  }, {
      "type": "integer",
      "value": "145"
  }]
  </code></pre>
  
  <p>Any advice would be appreciated.</p>