Skip to content

Instantly share code, notes, and snippets.

@parzibyte

parzibyte/imprimir.py Secret

Created Oct 30, 2020
Embed
What would you like to do?
"""
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
# Vamos desde el 1 hasta el 1000 (puse 1001 porque el límite no es inclusivo)
print("""
Imprimiendo números primos desde 1 hasta 1000
https://parzibyte.me/blog
""")
for numero in range(1001):
if primo(numero):
print(numero, end=","
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment