human
Self Numbers | Function to find the sum of digits of a number N.
Function to check for Self number.
Driver code"
Solution in Python:
assistant
#Here is code to self Numbers and the other steps required.
 def getSum ( n ) :
	sum1 = 0 ;
	while ( n != 0 ) :
		sum1 = sum1 + n % 10 ;
		n = n // 10 ;
	return sum1 ;
def isSelfNum ( n ) :
	for m in range ( 1 , n + 1 ) :
		if ( m + getSum ( m ) == n ) :
			return False ;
	return True ;
n = 20 ;
if ( isSelfNum ( n ) ) :
	print ( " Yes " ) ;
else :
	print ( " No " ) ;