Skip to content

Commit 2cf7e8f

Browse files
kostoglscclauss
andcommitted
fix comment (TheAlgorithms#1710)
* fix comment * Update armstrong_numbers.py Co-authored-by: Christian Clauss <[email protected]>
1 parent 9a8e7de commit 2cf7e8f

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

maths/armstrong_numbers.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
"""
2-
An Armstrong number is a number that is equal to the sum of the cubes of its digits.
2+
An Armstrong number is equal to the sum of the cubes of its digits.
33
For example, 370 is an Armstrong number because 3*3*3 + 7*7*7 + 0*0*0 = 370.
44
An Armstrong number is often called Narcissistic number.
55
"""
66

77

88
def armstrong_number(n: int) -> bool:
99
"""
10-
This function checks if a number is Armstrong or not.
10+
Return True if n is an Armstrong number or False if it is not.
1111
1212
>>> armstrong_number(153)
1313
True
@@ -42,9 +42,11 @@ def armstrong_number(n: int) -> bool:
4242
return n == sum
4343

4444

45-
# In main function user inputs a number to find out if it's an Armstrong or not. Th function armstrong_number is called.
4645
def main():
47-
num = int(input("Enter an integer number to check if it is Armstrong or not: ").strip())
46+
"""
47+
Request that user input an integer and tell them if it is Armstrong number.
48+
"""
49+
num = int(input("Enter an integer to see if it is an Armstrong number: ").strip())
4850
print(f"{num} is {'' if armstrong_number(num) else 'not '}an Armstrong number.")
4951

5052

0 commit comments

Comments
 (0)