From 6cd10b9ce89a60b732f9c27679c1396df3080d4d Mon Sep 17 00:00:00 2001 From: yashkumarjha12 <72943344+yashkumarjha12@users.noreply.github.com> Date: Thu, 6 Oct 2022 12:01:26 +0530 Subject: [PATCH] Create armstrong_num.py --- Python/armstrong_num.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 Python/armstrong_num.py diff --git a/Python/armstrong_num.py b/Python/armstrong_num.py new file mode 100644 index 0000000..c8ab56a --- /dev/null +++ b/Python/armstrong_num.py @@ -0,0 +1,11 @@ +num = int(input('enter the nuber')) +s = 0 +temp = num +while temp &amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt; 0: +c = temp % 10 +s += c**3 +temp //= 10 +if s == num: +print('armstrong number') +else: +print('not an armstrong number')