Why doesn't the loop in the following code work?
out what numbers are prime.
primes = [2,3,5,7,11,13,17,19,23]
finish = int(raw_input("What number would you like to check to? "))
start = 24
while start >= finish:
x = 0
while start % primes[x] != 0:
x = x + 1
start = start + 1
When run, it just prints out the default set of primes after taking the number you want the program to check up to.
Swat spam before it fills your inbox!
0 · ·