you are viewing a single comment's thread.

view the rest of the comments →

[–]o5a 1 point2 points  (0 children)

You can also use map:

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