;

# Python Program to Print all Prime Numbers Between a Specific Range

###### Tutorialsrack 22/04/2020 Python

In this Python Program, we will learn how to print all prime numbers between a specific range such as prime number 1 to 100 or any range 1 to nth.

Here is the source code to print all prime numbers between a specific range such as prime number 1 to 100 or any range 1 to nth.

##### Python Program to Print all Prime Numbers Between a Specific Range
``````# Python Program to Print all Prime Numbers Between a Specific Range

# Take Input From User
lowerrange = int(input("Enter a Lower number: "))
upperrange = int(input("Enter a Upper number: "))

print("\nPrime numbers between", lowerrange, "and", upperrange, "are: ")

for num in range(lowerrange, upperrange + 1):
# all prime numbers are greater than 1
if num > 1:
for i in range(2, num):
if (num % i) == 0:
break
else:
print(num)
``````
##### Output

Enter a Lower number: 1

Enter a Upper number: 100

Prime numbers between 1 and 100 are:

2

3

5

7

11

13

17

19

23

29

31

37

41

43

47

53

59

61

67

71

73

79

83

89

97