Prime number generation between two numbers in python programming


#Prime number generator between two numbers------
#Alamgir Hossain, CSE, JUST
x = input("Enter the first number : ")
y = input("Enter the last number : ")


print "Prime numbers between ", x, " and ",y," are : "for i in range(x,y+1):
    isprime = 0    if i==1:
        isprime =1    for j in range(2,i/2+1):
        if i%j==0:
            isprime = 1            break
    if isprime==0:
        print i," "

No comments:

Post a Comment