Function to return sum of squares of digits of N
def getSum ( n ) : NEW_LINE INDENT sum = 0 NEW_LINE while ( n != 0 ) : NEW_LINE INDENT r = n % 10 NEW_LINE sum = sum + r * r NEW_LINE n = n // 10 NEW_LINE DEDENT return sum NEW_LINE DEDENT