Inkortbaar priemgetal
Sign in to test your solution.
import math
def is_priem(getal):
i = 2
while i < math.sqrt(getal) + 1 and getal % i != 0:
i = i + 1
# Indien geen delers werden gevonden is i == getal
return (i == math.ceil(math.sqrt(getal) + 1) and getal != 1) or getal == 2
You can submit as many times as you like. Only your latest submission will be taken into account.
Sign in to test your solution.
Python sandbox
This window allows you to run Python code without installing a thing. The code you write here is not automatically submitted to Dodona.
Test case being debugged