Skip to content
Snippets Groups Projects
Commit ea035cfd authored by Tomas Santiago Rocha Mendoza's avatar Tomas Santiago Rocha Mendoza
Browse files

Upload New File

parent f597623e
No related branches found
No related tags found
No related merge requests found
%% Cell type:markdown id:32f5f438-05e8-419e-8e2d-ed0dd88e7311 tags:
# Números primos del 1 al 150 - Tomás Rocha
%% Cell type:code id:fa73257c-7de5-427d-9fda-600d08c0ff1a tags:
``` python
def prime_numbers(numero):
if numero < 2:
return False
for i in range(2, int(numero**0.5) + 1):
if numero % i == 0:
return False
return True
prim = []
for number in range(1, 151):
if prime_numbers(number):
prim.append(number)
print(prim)
```
%% Output
[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149]
%% Cell type:code id:172308b4-6f35-4a1a-8f08-3fdaf8017ef3 tags:
``` python
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment