DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR PYTHON
python sum of digits in a string
# Here is the short version number = 159 sum((int(n) for n in str(abs(number))))
Source by kite.com #
PREVIOUS
NEXT
Tagged:
#python
#sum
#digits
#string
ADD COMMENT
Topic
COMMENT
Name
2+7 =
Submit