Answer to Question #209067 in Electrical Engineering for mona

Question #209067

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.


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

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