i'm trying to figure out how to exclude certain numbers (numbers that aren't prime) in my program. For example, I don't want 15 to be printed so I used the modulo to exclude numbers divisible by 5 but that eliminates 5, which is a prime number. Any help on how to code this would be huge help! Thank you...
start = int(input("Start number: "))
end = int(input("End number: "))
while start < 0 or end < 0:
print ("Start and end number must be positive. Try again.")
start = int(input("Start number: "))
end = int(input("End number: "))
while start > end:
print ("End number must be greater than start number. Try again.")
for x in range (start, end):
is_prime = True
for x in range (start, end):
trial = x % 2
trial1 = x % 5
trial2 = x % 3
if trial != 0 and trial1 != 0 and trial2 != 0:
print (x, "is a prime number")
x = x + 1
else:
is_prime = False