Function to find the digital root of a number
def findDigitalRoot ( num ) : NEW_LINE INDENT sum = sys . maxsize ; NEW_LINE tempNum = num ; NEW_LINE while ( sum >= 10 ) : NEW_LINE INDENT sum = 0 ; NEW_LINE while ( tempNum > 0 ) : NEW_LINE INDENT sum += tempNum % 10 ; NEW_LINE tempNum //= 10 ; NEW_LINE DEDENT tempNum = sum ; NEW_LINE DEDENT return sum ; NEW_LINE DEDENT