103
Python Program to check Armstrong Number
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:
Example:
Example:
Output:
1# Please enter the number to be checked: 0 True 2# Please enter the number to be checked: 123 False 3# Please enter the number to be checked: 1634 True
Conclusion
In this tutorial, we discussed how to verify whether the given number is an Armstrong number or not.