P3: Udacity Data Analyst Nanodegree
Author: David Venturi
Date: June 15, 2016
P3: Udacity Data Analyst Nanodegree
Author: David Venturi
Date: June 15, 2016
"""A _narcissistic number_ is an `n`-digit whole number that is equal to the | |
sum of its digits raised to the power `n`. | |
For instance, `153` is such a 3-digit number (`1^3 + 5^3 + 3^3 = 153`) | |
and `8208` is a 4-digit example (`8^4+ 2^4 + 0^4 + 8^4 = 8208`). | |
Write a function `is_narcissistic(x)` that returns _true_ if `x` is | |
narcissistic. Now use this to find as many narcissistic numbers as you can. | |
How high up can you go? | |
Note: 1-digit numbers are all trivially narcissistic, so you may skip them. |