diff --git a/app.py b/app.py index 3428f26..01c71a5 100644 --- a/app.py +++ b/app.py @@ -72,6 +72,24 @@ def armstrong(): print(n,"is an Armstrong number") else: print(n,"is not an Armstrong number") + + def strong(): + sum=0 + num=int(input("Enter a number:")) + temp=num + while(num): + i=1 + fact=1 + rem=num%10 + while(i<=rem): + fact=fact*i + i=i+1 + sum=sum+fact + num=num//10 + if(sum==temp): + print("Given number is a strong number") + else: + print("Given number is not a strong number") if __name__=='__main__': add() @@ -80,5 +98,7 @@ def armstrong(): prime() print_factors() palindrome() + armstrong() + strong()