Print prime number

This is a python program to print all the Prime Number in an interval.

print("To print all the prime numbers between a given interval")

a=int(input("Enter first number:"))
b=int(input("Enter second number:"))

l1=a+1
while l1<b:
    l2=2
    temp=1
    while l2<l1/2:
        if l1%l2==0:
            temp=0



    if temp==1:
        print(l1)

 

Leave a Comment

%d bloggers like this:
Python4U
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.