Write and execute a PYTHON program to perform the following tasks.
1.Write a program in python to print prime numbers between any two numbers m to n.
m=int(input('Enter m: '))
n=int(input('Enter n: '))
if(n<=m):
print('Error: Enter n>m.')
else:
print('Prime numbers are:')
for number in range(m,n):
isPrime=True
if number > 1:
for i in range(2, number):
if (number % i) == 0:
isPrime=False
break
if isPrime:
print(str(number))
Comments
Leave a comment