Narcissistic number (Narcissistic number) is also known as super does not fully digital variable (pluperfect digital invariant, PPDI), the number of narcissism, since a power of Armstrong Armstrong number or number (Armstrong number), refers to the number of daffodils a 3-bit number on each of the digital bit 3 is equal to the sum of power itself (eg: 5 + 1 ^ 3 ^ 3 ^ 3 + 3 = 153).
code show as below:
def func(n):
if (n // 100) ** 3 + (n // 10 % 10) ** 3 + (n % 10) ** 3 == n and n > 100:
print '%d是水仙花数' %n
else:
print '%d不是水仙花数' %n
print func(153)
Output effect