for i in range(1042000,702648265): sum=0 temp=i while temp>0: r=temp%10 sum=sum+r**3 temp=temp//10 if sum==i: print("the first armstrong num",i) break
The main issue I'm getting is when I enter (1042000,702648265) as the range it's not working. But when I enter (1,999) or something less than this it's working perfectly. Hey, can anyone please help me with this.
Thank you!!
for i in range(1042000,702648265): sum=0 temp=i while temp>0: r=temp%10 sum=sum+r**3 temp=temp//10 if sum==i: print("the first armstrong num",i) break
The main issue I'm getting is when I enter (1042000,702648265) as the range it's not working. But when I enter (1,999) or something less than this it's working perfectly. Hey, can anyone please help me with this. Thank you!!