We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bc006ea commit 2b64dccCopy full SHA for 2b64dcc
ArmstrongNumberCheck.py
@@ -0,0 +1,9 @@
1
+print("An Armstrong Number is a number which is equal to the sum of the cubes of it's digits.")
2
+inputNumber = input("Enter a number to check if it's an Armstrong Number or not: ")
3
+sumOfCubes=0
4
+
5
+for digit in inputNumber:
6
+ sumOfCubes+=int(digit)**3
7
8
+if sumOfCubes==int(inputNumber): print(inputNumber,"is an Armstrong Number.")
9
+else: print(inputNumber,"is NOT an Armstrong Number.")
0 commit comments