Write and execute a PYTHON program to perform separate files for each of the tasks
1.o find the prime numbers between 1000 and 2000 and display the prime numbers in deseeding order.
# Python program to display all the prime numbers between 1000 and 2000
m=1000
n=2000
print("Prime numbers between", m, "and", n, "are:")
for i in reversed(range(m, n + 1)):
# all prime numbers are greater than 1
if i > 1:
for r in range(2, i):
if (i % r) == 0:
break
else:
print(i)
Comments
Leave a comment