Determine a number is not a number Armstrong

# Get user input digital 
x = int (input ( "Enter a number:"))
# initialize variables SUM
SUM = 0
# n-th power of the digits is calculated and
for I STR in (X):
SUM = SUM + ( int (I) ** len (STR (X)))
# Analyzing
IF SUM == X:
Print (True)
the else:
Print (False)

Guess you like

Origin www.cnblogs.com/tianyingz/p/12420161.html