Table of Contents
Python program to print all prime numbers in an Interval
prime number is the number which is only divisible by itself and by one.
Python program to find prime number between interval.
print("Please enter positive number greater then 1")
first_num = int(input("Enter first number : "))
last_num = int(input("Enter last number : "))
for i in range(first_num, last_num):
if i>1:
for j in range(2,i):
if(i % j==0):
break
else:
print(i)
Output :
Please enter positive number greater then 1
Enter first number : 5
Enter last number : 30
5
7
11
13
17
19
23
29
We are aiming to explain all concepts of python in easiest terms as possible.

ITVoyagers
Author
PRACTICALS/PRACTICE PROGRAM IN PYTHON
CHECKOUT OTHER RELATED TOPICS
CHECKOUT OTHER QUIZZES
Quizzes on File Handling |
Easy quiz on file handling in python part 1 |
Easy quiz on file handling in python part 2 |
Quizzes on Exception Handling |
Easy quiz on Exception Handling in python part 1 |
Easy Quiz on Exception Handling in python part 2 |
Quizzes on Regular Expressions |
Easy Quiz on Regular Expression in python part 1 |
Quizzes on Python concepts coming soon… |
Python basic quiz |
New and easy python quiz basic part 1 |
New and easy python quiz (basic) part 2 |
New and easy python quiz (basic) part 3 |
Python practice quiz set |
Best Practice Quiz Set on Python Programming Part 1 |
Best Practice Quiz Set on Python Programming Part 2 |
Best Practice Quiz Set on Python Programming Part 3 |
Best Practice Quiz Set on Python Programming Part 4 |
Best Practice Quiz Set on Python Programming Part 5 |