Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
405 B
1
Indexable
Never
import math
prime_candidate=500
while(prime_candidate<600):
    prime=True
    if (prime_candidate%2==0):
        prime=False
    else:
        for i in range(3,math.ceil(math.sqrt(prime_candidate))+1):
            if(prime_candidate%i==0):
                prime=False
        if(prime==True):
            print(str(prime_candidate)+" is a prime number")
    prime_candidate=prime_candidate +1