Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
351 B
3
Indexable
Never
def is_prime(number):
    if number <= 1:
        return False
    if number == 2:
        return True
    d = 2
    while d <= math.sqrt(number):
        if number % d == 0:
            return False
        d += 1
    return True
pierwsze = 0
for line in file:
    line = int(line)
    if is_prime(line) == True:
        pierwsze +=1

print(pierwsze)