Python program for checking if entered number is Special or not

sum=0

fac=1

n=int(input("Enter N : "))

x=n

while n!=0:

    t=n%10

    fac=1

    for i in range(t,0,-1):

        fac=fac*i

    sum+=fac

    n=n//10 

if sum==x:

    print("IT's A SPECIAL NUMBER!")

else:

    print("IT's NOT A SPECIAL NUMBER!")

Comments