diff --git a/armstrong.py b/armstrong.py new file mode 100644 index 00000000..f5c62333 --- /dev/null +++ b/armstrong.py @@ -0,0 +1,14 @@ +num = int(input("Enter a number: ")) +sum = num +a = len(str(num)) +sum1 = 0 + +while(num !=0 ): + b = num %10 + sum1 = sum1+(b**a) + num = num // 10 + +if(sum == sum1): + print("The number is armstrong") +else: + print("The number is",sum, "not am armstrong number")