title: Python summing digits in number ,'n'
body: <p>Im a novice programmer and stumbled upon a problem in codecademy with python.
  I get a random positive integer, n, and need to isolate the digits to sum them together and add the sum to a variable ,total</p>
  
  <p>Here is my code so far and remember I'm new to this!:)</p>
  
  <pre><code>def digit_sum(n):
      total = 0
      while len(str(n)) &gt; 0:
          total = total + n%10
          n -= n//10
  </code></pre>