title: Exercise on Summing Digits | What's with n // = 10
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1535596/what-is-the-reason-for-having-in-python">What is the reason for having ‘//’ in Python?</a>  </p>
  </blockquote>
  
  
  
  <p>While trying to do an exercise on summing digits, I stumbled on this solution:</p>
  
  <pre class="lang-py prettyprint-override"><code>def sum_digits(n):
     import math
     total = 0
     for i in range(int(math.log10(n)) + 1):
        total += n % 10
        n //= 10
     return total
  </code></pre>
  
  <p>My question is, what does the second to last line do? How is that proper syntax?</p>