write python code:
find the prime numbers between 1000 and 2000 and display the prime numbers in deseeding order.
print("Prime numbers between", 1000, "and", 2000, "are:")
for i in reversed(range(1000, 2000 + 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