From 6fdc869601157b21b9572d8f1120891ae22816ad Mon Sep 17 00:00:00 2001 From: Shlok Kumar <77238805+shlok2740@users.noreply.github.com> Date: Wed, 5 Oct 2022 16:01:08 +0530 Subject: [PATCH] Create Armstrong_Number.py --- Python/Armstrong_Number.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 Python/Armstrong_Number.py diff --git a/Python/Armstrong_Number.py b/Python/Armstrong_Number.py new file mode 100644 index 0000000..0b552f3 --- /dev/null +++ b/Python/Armstrong_Number.py @@ -0,0 +1,25 @@ +# A number that equals to the sum of its own digits, where each digit raised to the power of number of digits is known as Armstrong Number. + +num = int(input("Enter the Number: ")) + +temp = num +noOfDigit = 0 +res = 0 +while num>0: + num = int(num/10) + noOfDigit = noOfDigit+1 +num = temp +while num>0: + rem = num%10 + pow = 1 + i = 0 + while i