Last active
January 31, 2022 17:26
-
-
Save lucasbazan/9a3c45c81ede877aa0bb3b3431c55532 to your computer and use it in GitHub Desktop.
This function check if a number is prime or not.
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(num): | |
mult = [i for i in range(1, num+1) if num % i == 0] | |
if len(mult) == 2 and 1 in mult and num in mult: | |
return True | |
return False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment