armstrong number in python

Posted by Paidboom - 1 year ago

armstrong number in python : Python Program to Check Armstrong Number

num = input("Eneter your any selected Number: ") // 153
num = int(num)
total = 0
flag = num
while flag > 0:
    digit = flag % 10
    total += digit ** 3
    flag //= 10
if num == total :
    print("It is a confirm Armstrong Number")
else:
    print("It is a confirm not Armstrong Number")