You can download this code by clicking the button below.
This code is now available for download.
This function calculates the sum of all digits in an integer.
Technology Stack : Built-in Python libraries
Code Type : Function
Code Difficulty :
def sum_digits(number):
return sum(int(digit) for digit in str(number) if digit.isdigit())