[off-topic]

On 12/10/2013 01:39 PM, Wolfgang Maier wrote:
def digits(n):
     """Generator that breaks down an integer into digits from right to left."""
     while n>0:
         yield n % 10
         n //= 10

Aha! one more sign that we write numbers backwards!

Denis
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to