- 2
Why code is not running? Please anyone give me full solution 😭
i=int(input("enter number ")) sum=0 a=i while (i>0): rem=i%10 sum+=rem ** 3 i//10 if a==sum: print("this is a armstong no") else: print("number is not Armstrong no")
3 ответов
+ 3
Please don't keep posting the same thing.
https://www.sololearn.com/discuss/3082819/?ref=app
+ 2
as you never change the value of "i" inside of the loop, it will be an infinite loop if your input is anything > 0...
0
I//10 no use. It should be like
i = i//10
or
i //= 10 #short form.
And put if-else block after loop. Not inside.
If you are trying this in code coach, then your output should match with expected output, with no more or less character in the output..