Last active
November 25, 2022 14:26
-
-
Save mfilipelino/7c8e3b076f90e8c215a4a836c24c2856 to your computer and use it in GitHub Desktop.
is prime
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
def is_prime(number): | |
if number <= 0: | |
return False | |
if number == 1: | |
return True | |
elif number == 2: | |
return True | |
else: | |
for i in range(2, number): | |
if number % i == 0: | |
return False | |
return True |
Is
1
a prime number, technically, because it is only divisible by itself and1
(which is itself)?
Ok, Thanks I'm correctly now.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is
1
a prime number, technically, because it is only divisible by itself and1
(which is itself)?