Question #320496

Armstrong number between two intervals


Expert's answer

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?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS