'''Python program for sum of digits of an integer ''' #grab the number num = int(input("Enter a number: ")) sum = 0 #grab the last digit, add to sum. #Divide by 10 to get the next digit. Keep going until number is 0 while num > 0: rem = int(num % 10) sum = sum + rem num = int(num / 10) #print the answer print("The sum is ", sum)