From 951603809515a15b8ef92672c19bfbc987fb694d Mon Sep 17 00:00:00 2001 From: ConstanzaSegoviaA Date: Tue, 13 Jan 2026 13:02:07 +0100 Subject: [PATCH 1/2] listo --- cfu-data-types.ipynb | 55 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 46 insertions(+), 9 deletions(-) diff --git a/cfu-data-types.ipynb b/cfu-data-types.ipynb index e0fee02..f21297c 100644 --- a/cfu-data-types.ipynb +++ b/cfu-data-types.ipynb @@ -49,11 +49,33 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Constanza, que tiene 39 años y vive en arenal 6, con su salario y lo que gasta en un mes le quedan 450.0 euros. Es False que le quedan más de $500.\n" + ] + } + ], "source": [ - "# Your code here\n" + "nombre= input(\"Ingrese su nombre: \")\n", + "edad= input(\"Ingrese su edad: \")\n", + "direccion= input(\"Ingrese su dirección: \")\n", + "salario= input(\"Ingrese su salario mensual: \")\n", + "gastos= input(\"Ingrese sus gastos mensuales: \")\n", + "\n", + "edad=int(edad)\n", + "salario= float(salario)\n", + "gastos= float(gastos)\n", + "\n", + "resto=round(salario - gastos, 1)\n", + "\n", + "valor= resto>=500\n", + "\n", + "print(f\"{nombre}, que tiene {edad} años y vive en {direccion}, con su salario y lo que gasta en un mes le quedan {resto} euros. Es {valor} que le quedan más de $500.\")\n" ] }, { @@ -85,7 +107,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ @@ -102,17 +124,32 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 5, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "El poema tiene 51 palabras.\n", + "Some say the world will end in fire Some say in ice From what I’ve tasted of desire I hold with those who favor fire But if it had to perish twice I think I know enough of hate To say that for destruction ice Is also great And would suffice\n" + ] + } + ], "source": [ - "# Your code here\n" + "limpiar= poem.replace(',', '').replace('.', '').replace('\\n', ' ')\n", + "palabras= limpiar.split(' ')\n", + "longitud= len(palabras)\n", + "\n", + "print(f\"El poema tiene {longitud} palabras.\")\n", + "\n", + "print(limpiar)" ] } ], "metadata": { "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "Python 3", "language": "python", "name": "python3" }, @@ -126,7 +163,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.13" + "version": "3.13.1" } }, "nbformat": 4, From 52aabbef72388ba0488a7fbd439d799846443a7f Mon Sep 17 00:00:00 2001 From: ConstanzaSegoviaA Date: Tue, 13 Jan 2026 13:08:50 +0100 Subject: [PATCH 2/2] Cambio --- cfu-data-types.ipynb | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/cfu-data-types.ipynb b/cfu-data-types.ipynb index f21297c..6f49bf1 100644 --- a/cfu-data-types.ipynb +++ b/cfu-data-types.ipynb @@ -124,26 +124,24 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 7, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "El poema tiene 51 palabras.\n", - "Some say the world will end in fire Some say in ice From what I’ve tasted of desire I hold with those who favor fire But if it had to perish twice I think I know enough of hate To say that for destruction ice Is also great And would suffice\n" + "Las palabras son 258\n", + "['some', 'say', 'the', 'world', 'will', 'end', 'in', 'fire', 'some', 'say', 'in', 'ice', 'from', 'what', 'i’ve', 'tasted', 'of', 'desire', 'i', 'hold', 'with', 'those', 'who', 'favor', 'fire', 'but', 'if', 'it', 'had', 'to', 'perish', 'twice', 'i', 'think', 'i', 'know', 'enough', 'of', 'hate', 'to', 'say', 'that', 'for', 'destruction', 'ice', 'is', 'also', 'great', 'and', 'would', 'sufficepython', 'is', 'awesome!']\n" ] } ], "source": [ - "limpiar= poem.replace(',', '').replace('.', '').replace('\\n', ' ')\n", - "palabras= limpiar.split(' ')\n", - "longitud= len(palabras)\n", - "\n", - "print(f\"El poema tiene {longitud} palabras.\")\n", - "\n", - "print(limpiar)" + "clean_txt = poem.lower().replace(\",\", \"\").replace(\".\", \"\").replace(\"\\n\", \" \")\n", + "nuevo_txt = clean_txt + \"python is awesome!\"\n", + "print(\"Las palabras son\", len(nuevo_txt))\n", + "poem_list = nuevo_txt.split(\" \")\n", + "print(poem_list)" ] } ],