how to solve this question?

Question: Write a function that takes as parameter an integer value and returns the sum of the digits in the integer, e.g. if the integer is 4123, then the function returns value 10(i.e. 4+1+2+3).Note that the integer can contain any number of digits.