In this article, we will show you, How to write a Python Program to print Strong numbers from 1 to 100, or 1 to n, or minimum to maximum with example.

**TIP:** I suggest you to refer Factorial, and Strong Number articles to understand the logic.

## Python Program to print Strong Numbers from 1 to 100

This python program allows the user to enter the maximum limit value. Next, this program will print strong numbers from 1 to user entered value.

First, we used For Loop to iterate loop between 1 and maximum value. Within the for loop,

- We used While Loop to split the given number. So that we can find the factorial of each Digit in a Number.
- Within the While loop we used factorial function to find the factorial.
- If statement is to check whether a given number is Strong Number or Not by comparing original value with sum of factorials.

# Python Program to print Strong Numbers from 1 to N import math maximum = int(input(" Please Enter the Maximum Value: ")) for Number in range(1, maximum): Temp = Number Sum = 0 while(Temp > 0): Reminder = Temp % 10 Factorial = math.factorial(Reminder) Sum = Sum + Factorial Temp = Temp // 10 if (Sum == Number): print(" %d is a Strong Number" %Number)

**OUTPUT**

## Python Program to print Strong Numbers from 1 to N

In this program we are allowing user to enter minimum and maximum values. Next, it will print strong numbers between minimum and maximum values

# Python Program to print Strong Numbers from 1 to N import math minimum = int(input(" Please Enter the Minimum Value: ")) maximum = int(input(" Please Enter the Maximum Value: ")) for Number in range(minimum, maximum): Temp = Number Sum = 0 while(Temp > 0): Reminder = Temp % 10 Factorial = math.factorial(Reminder) Sum = Sum + Factorial Temp = Temp // 10 if (Sum == Number): print(" %d is a Strong Number" %Number)

**OUTPUT**