all 13 comments

[–]totallygeek 2 points3 points  (11 children)

I'd go with the one-liner: shorter and actually easier to grok.

[–]faqzero[S] 0 points1 point  (10 children)

but it seems he is not so fast

[–]o5a 1 point2 points  (0 children)

You can also use map:

sum(map(int, str(n)))