Python program to print all Prime numbers in an Interval

Asked: Anonymously |Category: Python

lower = eval(input("Enter lower value"))

upper = eval(input("Enter upper value"))


print("Prime numbers between", lower, "and", upper, "are:")


for num in range(lower, upper + 1):

if num > 1:

for i in range(2, num):

if (num % i) == 0:

break

else:

print(num)

15 views

Recent Posts

See All

"Believe you can and you're halfway there"