Python program to find strong number; Through this tutorial, i am going to show you how to find strong number in python.

## Python Program to Find Strong Number

- Python Program to find Strong Number using While Loop.
- Strong Number in Python using For Loop.
- Strong Number in Python using Function.

### Python Program to find Strong Number using While Loop

# Python Program to find Strong Number using while loop Num = int(input(" Please Enter any Number: ")) Sum = 0 Temp = Num while(Temp > 0): Factorial = 1 i = 1 Reminder = Temp % 10 while(i <= Reminder): Factorial = Factorial * i i = i + 1 print("\n Factorial of %d = %d" %(Reminder, Factorial)) Sum = Sum + Factorial Temp = Temp // 10 print("\n Sum of Factorials of a Given Number %d = %d" %(Num, Sum)) if (Sum == Num): print(" %d is a Strong Number" %Num) else: print(" %d is not a Strong Number" %Num)

**Output**

Please Enter any Number: 165 Factorial of 5 = 120 Factorial of 6 = 720 Factorial of 1 = 1 Sum of Factorials of a Given Number 165 = 841 165 is not a Strong Number

### Strong Number in Python using For Loop

# Python Program to find Strong Number using for loop Num = int(input(" Please Enter any Number: ")) Sum = 0 Temp = Num while(Temp > 0): Factorial = 1 Reminder = Temp % 10 for i in range(1, Reminder + 1): Factorial = Factorial * i print("Factorial of %d = %d" %(Reminder, Factorial)) Sum = Sum + Factorial Temp = Temp // 10 print("\n Sum of Factorials of a Given Number %d = %d" %(Num, Sum)) if (Sum == Num): print(" %d is a Strong Number" %Num) else: print(" %d is not a Strong Number" %Num)

**Output**

Please Enter any Number: 145 Factorial of 5 = 120 Factorial of 4 = 24 Factorial of 1 = 1 Sum of Factorials of a Given Number 145 = 145 145 is a Strong Number

### Strong Number in Python using Function

# Python Program to find Strong Number using function import math Num = int(input(" Please Enter any Number: ")) Sum = 0 Temp = Num while(Temp > 0): Reminder = Temp % 10 Factorial = math.factorial(Reminder) print("Factorial of %d = %d" %(Reminder, Factorial)) Sum = Sum + Factorial Temp = Temp // 10 print("\n Sum of Factorials of a Given Number %d = %d" %(Num, Sum)) if (Sum == Num): print(" %d is a Strong Number" %Num) else: print(" %d is not a Strong Number" %Num)

**Output**

Please Enter any Number: 40585 Factorial of 5 = 120 Factorial of 8 = 40320 Factorial of 5 = 120 Factorial of 0 = 1 Factorial of 4 = 24 Sum of Factorials of a Given Number 40585 = 40585 40585 is a Strong Number

## Recommended Python Tutorials

**Recommended:-**Python Program to Find Power of Number

**Recommended:-**Python Program to Print Prime Number From 1 to N

**Recommended:-**Python Program to Find Square Root of Number

**Recommended:-**Python Program to Find Cube of Number

**Recommended:-**Python Palindrome Program

**Recommended:-**Python Program to Count Set Bits in a Number

**Recommended:-**Python Program for BMI Calculation

**Recommended:-**Python Program to Find Out Absolute Value

**Recommended:-**Python Random Number Generator Code

**Recommended:-**Python program for Zip, Zap and Zoom game

**Recommended:-**Python Program to Swap Two Numbers

**Recommended:-**Python Program to Find n-th term of Fibonacci Series

## Be First to Comment