title: Sum of digits in a string
body: <p>if i just read my <code>sum_digits</code> function  here, it makes sense in my head but it seems to be producing wrong results. Any tip?</p>
  
  <pre><code>def is_a_digit(s):
  ''' (str) -&gt; bool
  
  Precondition: len(s) == 1
  
  Return True iff s is a string containing a single digit character (between
  '0' and '9' inclusive).
  
  &gt;&gt;&gt; is_a_digit('7')
  True
  &gt;&gt;&gt; is_a_digit('b')
  False
  '''
  
  return '0' &lt;= s and s &lt;= '9'
  
  def sum_digits(digit):
      b = 0
      for a in digit:
          if is_a_digit(a) == True:
              b = int(a)
              b += 1
  
      return b
  </code></pre>
  
  <p>For the function <code>sum_digits</code>, if i input <code>sum_digits('hihello153john')</code>, it should produce <code>9</code></p>