Skip to content

Instantly share code, notes, and snippets.

@FerPerales
Created July 14, 2012 18:43
Show Gist options
  • Save FerPerales/3112626 to your computer and use it in GitHub Desktop.
Save FerPerales/3112626 to your computer and use it in GitHub Desktop.
Primer numbers
def primos(limite):
primos = []
for elemento in range(2,limite):
encontrado = False
for primo in primos:
if elemento % primo == 0 and elemento is not primo:
encontrado = True
break
if not encontrado:
primos.append(elemento)
return primos
@FerPerales
Copy link
Author

A function that returns all the prime numbers between 0 and limite

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment