-
-
Save parzibyte/51110da71ca7f22fe45e1873a8c6d730 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
""" | |
https://parzibyte.me/blog | |
""" | |
def primo(numero): | |
if numero == 0 or numero == 1 or numero == 4: | |
return False | |
for x in range(2, int(numero/2)): | |
if numero % x == 0: | |
return False | |
return True | |
# Probar | |
numero = int(input("Dame un número: ")) | |
es_primo = primo(numero) | |
if es_primo: | |
print("Es primo") | |
else: | |
print("NO es primo") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment