Skip to content

Commit 785ab21

Browse files
authored
Update armstrong_numbers.py
1 parent 8644500 commit 785ab21

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

maths/armstrong_numbers.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,8 @@ def narcissistic_number(n: int) -> bool:
4646
"""Return True if n is a narcissistic number or False if it is not"""
4747

4848
expo = len(str(n)) # power, all number will be raised to
49-
temp = [
50-
(int(i) ** expo) for i in str(n)
51-
] # each digit will be multiplied expo times
49+
# each digit will be multiplied expo times
50+
temp = [(int(i) ** expo) for i in str(n)]
5251

5352
# check if sum of cube of each digit is equal to number
5453
return n == sum(temp)

0 commit comments

Comments
 (0)