Skip to content

Instantly share code, notes, and snippets.


parzibyte/ Secret

Last active Oct 30, 2020
What would you like to do?
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")
print("NO es primo")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment