Python program to check if a number is an armstrong number

1638
Python program to check if a number is an armstrong number
n=int(input("Please enter any number: "))
a=list(map(int,str(n)))
b=list(map(lambda x:x**3,a))
if(sum(b)==n):
    print("The number is an armstrong number ")
else:
    print("The number is not an arsmtrong number ")

    Output 1:
            Please enter any number: 31
            The number is not an arsmtrong number
    Output 2:
            Please enter any number: 371
            The number is an armstrong number

इन्हें भी देखें।

Python Programs के लिये यहाँ click करें।

 

 

 

Python program to check if a number is an armstrong number program to check if a number is an armstrong number program to check if a number is an armstrong number in python write a python program to check if a number is an armstrong number write a program to check if a number is an armstrong number in python check if a number is an armstrong number in python python program to check whether a number is an armstrong number or not write program to check whether a number is an armstrong number or not python program to check whether a number is an armstrong number program to check whether a number is armstrong number or not python program to check if a given number is an armstrong number or not python program to check if a number is armstrong or not python program to check whether the given number is an armstrong number or notpython program to check whether a number is armstrong number or not python program to check whether a number is armstrong or not verify if the given number is an armstrong number or not program to check whether the number is armstrong or not write a program to check whether a number is armstrong or not program to check whether the given number is armstrong or not program to check whether the given number is armstrong or not in python