• Follow Us

Print all Numbers in a Range Divisible by a Given Number in python

In this Basic Python Program, we will have a look at how to print all Numbers in a Range Divisible by a Given Number in python.

Python program to Print all Numbers in a Range Divisible by a Given Number in python

lower=int(input("Please enter lower range limit:"))
upper=int(input("Please enter upper range limit:"))
n=int(input("Enter the number to be divided by:"))
for i in range(lower,upper+1):
if(i%n==0):
print(i) 

Output:

Please enter upper range limit:50
Please enter the number to be divided by:5
5
10
15
20
25
30
35
40
45
50

 

25

30

35

40

45

50

Leave a Reply

Your email address will not be published. Required fields are marked *

Shopping cart