Python - WAP to determine if a Number is Armstrong in Python - 18
#!/bin/usr/Python3 while True: print () num=int(input(" Enter any number: ")) a=list(map(int,str(num))) b=list(map(lambda x:x**3,a)) if(sum(b)==num): print("The Number is an Armstrong Number! ") else: print("The Number isn't an Arsmtrong Number! ") if (input(" To Continue 'y' : ") == 'y'): continue else: break
Program Output:
....
Post a Comment