In the following example, we will find the sum of any given digits.
num =int(input("Enter a (int) number: "));
copyNum = num;
#Add Each digit from last digit.while(copyNum !=0):
total += copyNum %10
copyNum = math.floor(copyNum /10)
print("The sum of digit %d: %d"% (num, total))