We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8644500 commit 785ab21Copy full SHA for 785ab21
maths/armstrong_numbers.py
@@ -46,9 +46,8 @@ def narcissistic_number(n: int) -> bool:
46
"""Return True if n is a narcissistic number or False if it is not"""
47
48
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
+ # each digit will be multiplied expo times
+ temp = [(int(i) ** expo) for i in str(n)]
52
53
# check if sum of cube of each digit is equal to number
54
return n == sum(temp)
0 commit comments