Armstrong number between two intervals
n1 = int(input('start: ')) n2 = int(input('end: ')) for i in range(n1,n2+1): p = len(str(i)) s = 0 for d in str(i): s += int(d)**p if s == i: print(i)
Need a fast expert's response?
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
Comments
Leave a comment