If I want to find the sum of the digits of a number, i.e.:
932
14
(9 + 3 + 2)
num = 123 dig = 0 sum = 0 while(num > 0): dig = int(num%10) sum = sum+dig num = num/10
print(sum) // make sure to add space above this line