Commit 6991deac authored by Alejandro Molina Villegas's avatar Alejandro Molina Villegas

numpy clase

parents b91912e7 2434cc60
...@@ -241,7 +241,7 @@ ...@@ -241,7 +241,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 55, "execution_count": 2,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
...@@ -297,6 +297,38 @@ ...@@ -297,6 +297,38 @@
"print(list(doublesG))" "print(list(doublesG))"
] ]
}, },
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Cuatos Fibonacci?: 6\n",
"0\n",
"1\n",
"1\n",
"2\n",
"3\n",
"5\n"
]
}
],
"source": [
"a = int(input('Cuatos Fibonacci?: '))\n",
"\n",
"def fib(n):\n",
" a, b = 0, 1\n",
" for _ in range(n):\n",
" yield a\n",
" a, b = b, a + b\n",
"\n",
"for n in fib(a):\n",
" print(n)"
]
},
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": {}, "metadata": {},
......
This diff is collapsed.
This diff is collapsed.
...@@ -4,7 +4,146 @@ ...@@ -4,7 +4,146 @@
"cell_type": "markdown", "cell_type": "markdown",
"metadata": {}, "metadata": {},
"source": [ "source": [
"# Examen Unidad 1" "# 4 Examen Unidad 1\n",
"Escribe una función o classe y su docstring para los siguientes ejercicios. "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 4.1 Obten el promedio de los numeros en una lista."
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"def ejercicio1(lista):\n",
" pass"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 4.2 Regresa todos los numeros enteros en una lista dividida por un numero."
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"def ejercicio2(lista, numero):\n",
" pass"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 4.3 Encuentra el factorial de un numero usando recursion.\n"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"def ejercicio3(numero):\n",
" pass"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 4.4 Encuentra todos los numeros que sean impares y palindromos en un rango dado."
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
"def ejercicio4(minimo, maximo):\n",
" pass"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 4.5 Escribe una funcion que reciba una plabra y un numero e interactue con el usuario para jugar *ahorcado*, el usuario tiene un numero maximo de intentos para adivinar la palabra:\n",
"[Wikipedia](https://es.wikipedia.org/wiki/Ahorcado_(juego))"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
"def ejercicio5(palabra, intentos):\n",
" pass"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 4.6 Escribe una funcion que reciva un texto y regrese un diccionario ordenado con el numero de occurencias de cada palabra en el texto."
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
"def ejercicio6(texto):\n",
" pass"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 4.7 Escribe una clase que convierta un numero entero a numero romano."
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [],
"source": [
"class ejercicio7:\n",
" pass"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 4.8 Escribe una funcion que regrese el cuadrado mágico del tamaño indicado.\n",
"[Wikipedia](https://es.wikipedia.org/wiki/Cuadrado_m%C3%A1gico) Cuadrado Mágico"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [],
"source": [
"def ejercicio8(n):\n",
" pass"
] ]
}, },
{ {
...@@ -549,7 +688,11 @@ ...@@ -549,7 +688,11 @@
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython3", "pygments_lexer": "ipython3",
<<<<<<< HEAD
"version": "3.7.1" "version": "3.7.1"
=======
"version": "3.5.3"
>>>>>>> 2434cc60fabe38fd65113b4dde7e3818935de3a6
} }
}, },
"nbformat": 4, "nbformat": 4,
......
This diff is collapsed.
# Tópicos Avanzados de Programación
## Instalación de Herramientas
```bash
sudo apt-get install python3 pip3
python3 -m pip install --upgrade pip
pip3 install jupyter
```
This diff is collapsed.
No preview for this file type
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment