LetsUpgrade / Python-Essentials

402 stars 234 forks source link

can anyon ehlp with armstrong assignment #23

Open preethi039 opened 4 years ago

vidyasrineeharika commented 4 years ago

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!!

maranix commented 4 years ago

@vidyasrineeharika @preethi039 refer to this https://github.com/ramanverma2k/LetsUpgrade/blob/master/Python%20Essentials/Day%204/Python_Essesntials_Day_4_Assignment.ipynb

I hope it helps you understand.