I didn't see this posted in here and I had an evening to think about this and you do get to read some very interesting stuff about floating points and python in doing this.

% 10 gives you the right most digit since that digit is the remainder when you divide a number by 10. Then subtract the remainder from the original number, divide by 10 and continue until the number is 0.