Posts

Showing posts with the label Armstrong number

Armstrong number

Armstrong number       import math      n=int(input())      x=n      s=str(n)      l=len(s)      b=0      while(n>0): a=n%10 b=b+pow(a,l) n=n//10      if(x==b): print(True)      else: print(False)