human
Narcissistic number | Python program for checking of Narcissistic number.
Traversing through the string.
Converting character to int.
Converting string to integer.
Comparing number and sum.
Driver Code taking input as string"
How can the above be solved in Python?
assistant
#Here is code to narcissistic number and the other steps required.
 def getResult ( st ) :
	sum = 0
	length = len ( st )
	for i in st :
		sum = sum + int ( i ) ** length
	number = int ( st )
	if ( number == sum ) :
		return " true "
	else :
		return " false "
st = "153"
print ( getResult ( st ) )