diff --git a/ArmstrongNumberInPython.py b/ArmstrongNumberInPython.py new file mode 100644 index 0000000..6a25352 --- /dev/null +++ b/ArmstrongNumberInPython.py @@ -0,0 +1,12 @@ + +print("All Armstrong Numbers from 1 to 500 are:- ") +for i in range(1,501): + num2=i + rem=0 + check=0 + while(i>0): + rem=i%10 + check+=rem**len(str(num2)) + i//=10 + if(check==num2): + print(num2)