Created
January 6, 2021 09:29
-
-
Save PaburoTC/94c4cea427e0877262a602c245503805 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
def is_prime(n): | |
"""Determines if a non-negative integer is prime.""" | |
if n < 2: | |
return False | |
for i in range(2, int(math.sqrt(n)) + 1): | |
if n % i == 0: | |
return False | |
return True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment