A recursion to print all Armstrong number between 100 and 999.

please make it as simpler as possible... im a beginner in python language

17th Jan 2020, 1:10 PM
Urmi - avatar
2 odpowiedzi
+ 3
Where's your attempt? Where did you get stuck?
17th Jan 2020, 1:17 PM
HNNX ­čÉ┐ - avatar
+ 1
def armsrecurs(n=100,sum1=0): while(n<=999): t=n a=int(n%10) n=int(n/10) b=int(n%10) c=int(n/10) sum1+= (a**3)+(b**3)+(c**3) if(sum1==t): print(t) n=t n=n+1 sorry I have no idea how to call the function in this program ;-;
17th Jan 2020, 2:03 PM
Urmi - avatar