Find a prime number between two number?

All QuestionsCategory: PythonFind a prime number between two number?
chetan shidling asked 4 years ago

I need code.

1 Answers
chetan shidling answered 4 years ago

Use this code to find a prime number between two numbers.
 

x = int(input("enter lower range:"))
y = int(input("enter higher rage:"))
for i in range(x,y+1):
if i >1:
for j in range(2,i):
if(i%j)==0:
break
else:
print(i)