title: I am creating a recurring number generator and I keep getting a ValueError
body: <p>I keep getting a ValueError for this code. Can someone help me out here?</p>
  <pre class="lang-py prettyprint-override"><code>f = open('perrin.txt','a')
  perrinv.append(perrin(value))
  perrinfd[(int(str(perrin(value))[0]))-1] += 1
  rfd = [perrinfd[x]/sum(perrinfd) for x in range(0,9)]
  error = sum([abs(rfd[x]-benFreqs[x]) for x in range(0,9)])
  f.write(str(error)+'\n')
  f.close()
  </code></pre>
  <p>Here is the error</p>
  <pre><code>Traceback (most recent call last):
    File &quot;main.py&quot;, line 107, in &lt;module&gt;
      perrinfd[(int(str(perrin(value))[0]))-1] += 1
  ValueError: invalid literal for int() with base 10: '-'
  </code></pre>
  <p>Can someone help me out?</p>