Question: Narcissistic numbers Prompt the user for an upper and a lower bound.(Note: we will test for at least 100-50000 range) Display all the narcisstic numbers that exist between the lower and upper bounds, both inclusive. https://en.wikipedia.org/wiki/Narcissistic_number This link describes what narcisstic numbers are. A narcisstic number of order 4 is a 4-digit number, such that the number xyzd = x^4 + y^4 + z^4 + d^4 A narcisstic number of order 3 is a 3-digit number, such that the number xyz = x^3 + y^3 + z^3 e.g. 153 is a narcissistic number of order 3 as 1^3 + 5^3 + 3^3 is equal to 153 where the ^ operator indicates raised to the power of, e.g. x^3 is x raised to the power of 3. In Python, x**3 is used to calculate x raised to the power of 3.
Question: Narcissistic numbers
Prompt the user for an upper and a lower bound.(Note: we will test for at least 100-50000 range) Display all the narcisstic numbers that exist between the lower and upper bounds, both inclusive.
https://en.wikipedia.org/wiki/Narcissistic_number
This link describes what narcisstic numbers are.
-
A narcisstic number of order 4 is a 4-digit number, such that the number xyzd = x^4 + y^4 + z^4 + d^4
-
A narcisstic number of order 3 is a 3-digit number, such that the number xyz = x^3 + y^3 + z^3
e.g. 153 is a narcissistic number of order 3 as 1^3 + 5^3 + 3^3 is equal to 153
where the ^ operator indicates raised to the power of, e.g. x^3 is x raised to the power of 3.
In Python, x**3 is used to calculate x raised to the power of 3.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 2 images