k=[] for num in range(100,1000): temp=num s=0 while(num>0): r=num%10 s+=(r*r*r) num=num//10 if(temp==s): k.append(s) print("Armstrong numbers between 100 and 1000 are:") for i in range(len(k)): print(k[i]) input("Press enter to exit")