Suppose we have a given number, "K", and we have to check whether the given number is an Armstrong number or not. In this tutorial, we will learn how to identify the given number is an Armstrong number or not using Python.
Definition:
A positive number of "p" number of digits is called an Armstrong number of order n (order is the number of digits) if:
abcde? = pow(a, p) + pow(b, p) + pow(c, p) + pow(d, p) + pow(e, p) + ?
Example:
Output:
Conclusion
In this tutorial, we discussed how to verify whether the given number is an Armstrong number or not.
need an explanation for this answer? contact us directly to get an explanation for this answer