Answer to Question #209677 in Electrical Engineering for mona

Question #209677

write python code:

find the prime numbers between 1000 and 2000 and display the prime numbers in deseeding order.


1
Expert's answer
2021-06-23T05:54:28-0400
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)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS