#---------------------------- Check whether a number is strong number ------------------------
'''A number is said to Strong number if sum of factorial of all of its digit is equal to the original number '''
num = int(input("Enter a number : "))
fact=1
temp =num
sum =0
while(num>0):
last= num % 10 # divides the last digit
num = num //10 # removes last digit
fact = 1 # reset fact = 1 after completing one last digit
for i in range(1,last+1):
fact =fact*i
sum += fact
if sum ==temp:
print(temp,"is a strong number.")
else:
print(temp,"is not a strong number.")
#---------------------------- Check whether a number is amstrong number ----------------------
'''A number is said to be Amstrong number if sum of all digits to power of number of digits is equal to the original number '''
num = int(input("Enter the number : ")) # getting input from user
ams = num # assigning input value to the s variable
b = len(str(num))
sum1 = 0
# checking amstrong
while num != 0:
rem = num % 10
sum1 = sum1+(rem ** b)
num = num//10
if ams == sum1:
print("The given number", ams, "is armstrong number")
else:
print("The given number", ams, "is not armstrong number")
#---------------------------- Check whether a number is amstrong number ----------------------
'''A number is said to be Amstrong number if 'sum of all digits to power of number of digits ' is equal to the original number '''
num = int(input("Enter a number :"))
sum=0
count =0
temp =num
while(num>0):
num=num//10
count +=1
num =temp
while(num>0):
last = num % 10
num = num//10
pow =1
for i in range(1,count+1):
pow *= last
sum += pow
if(sum == temp):
print(temp,"is a Amstrong number")
else:
print(temp,"is not a Amstrong number")
print()