From 082d1735d1101acb34c0e23f356f06da81de36ce Mon Sep 17 00:00:00 2001 From: Vaibhav Date: Fri, 1 Oct 2021 09:50:54 +0530 Subject: [PATCH] Create ArmstrongNumber.py --- Algorithms/ArmstrongNumber.py | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 Algorithms/ArmstrongNumber.py diff --git a/Algorithms/ArmstrongNumber.py b/Algorithms/ArmstrongNumber.py new file mode 100644 index 0000000..3cdef22 --- /dev/null +++ b/Algorithms/ArmstrongNumber.py @@ -0,0 +1,8 @@ +n = str(input("Enter Number: ")) +s = 0 +for i in n: + s = s + int(i)**3 +if(s == int(n)): + print("Number is armstrong.") +else: + print("Number is not armstrong.")