Header Ads

Python - WAP to determine if a Number is Armstrong in Python - 18

This is a Python Code to Print the Largest Odd or Even Number of a List in Python.

Source Code:
#!/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: 



....

No comments