Skip to content

Commit 342b271

Browse files
author
ARRVINDH PK
committed
Add algorithm to check Armstrong number
1 parent f86a6bd commit 342b271

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

maths/is_armstrong_number.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,10 @@ def is_armstrong_number(number: int) -> bool:
44
An Armstrong number is a number that is equal to the sum
55
of its own digits each raised to the power of the number of digits.
66
7+
Wikipedia: https://en.wikipedia.org/wiki/Narcissistic_number
8+
79
>>> is_armstrong_number(153)
810
True
9-
>>> is_armstrong_number(370)
10-
True
11-
>>> is_armstrong_number(371)
12-
True
13-
>>> is_armstrong_number(9474)
14-
True
1511
>>> is_armstrong_number(123)
1612
False
1713
"""

0 commit comments

Comments
 (0)