Efficiënt bepalen van een priemgetal

Sign in to test your solution.
getal = int( input( "Geef een getal in: " ) ) is_priem = True for i in range(2, getal): if getal % i == 0: is_priem = False if is_priem: print(getal, "is priem.") else: print(getal, "is niet priem.")

  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