{"id":6802,"date":"2023-11-04T17:17:50","date_gmt":"2023-11-04T11:47:50","guid":{"rendered":"https:\/\/python-programs.com\/?p=6802"},"modified":"2023-11-10T12:17:21","modified_gmt":"2023-11-10T06:47:21","slug":"python-program-to-check-armstrong-number","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-program-to-check-armstrong-number\/","title":{"rendered":"Python Program to Check Armstrong Number"},"content":{"rendered":"

Armstrong Number:<\/strong><\/p>\n

Beginners sometimes ask what the Armstrong number, also known as the narcissist number, is. Because of the way the number behaves in a given number base, it is particularly interesting to new programmers and those learning a new programming language. The Armstrong number meaning in numerical number theory is the number in any given number base that forms the sum of the same number when each of its digits is raised to the power of the number’s digits.<\/p>\n

Ex: 153, 371 etc.<\/strong><\/p>\n

Example1:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

number =153<\/pre>\n

Output:<\/strong><\/p>\n

153 is Armstrong number<\/pre>\n

Explanation:<\/strong><\/p>\n

Here 1^3 + 5^3 + 3^3 = 153  so it is Armstrong Number<\/pre>\n

Example2:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

number =79<\/pre>\n

Output:<\/strong><\/p>\n

79 is not Armstrong number<\/pre>\n

Explanation:<\/strong><\/p>\n

Here 7^2 + 9^2 = 130 not equal to 79  so it is not Armstrong Number<\/pre>\n

Armstrong Number in Python<\/h2>\n

Below are the ways to check Armstrong number in python<\/p>\n