title: Invalid literal for int with base 10: ''
body: <pre><code>&gt;&gt;&gt; n = ''.join(i for i in x if i.isdigit())
  &gt;&gt;&gt; n.isdigit()
  True
  &gt;&gt;&gt; x.isdigit()
  False
  
  &gt;&gt;&gt; previous = 0
  &gt;&gt;&gt; next = 100
  &gt;&gt;&gt; answer = 0
  
  
  &gt;&gt;&gt; for i in range(0,100):
  ...     answer += int(n[previous:next])
  ...     previous = next
  ...     next += 100
  ... 
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 2, in &lt;module&gt;
  ValueError: invalid literal for int() with base 10: ''
  </code></pre>
  
  <p>Why am I getting this error ? As you can see n is digit..</p>