diff --git a/cfu-data-types.ipynb b/cfu-data-types.ipynb index e0fee02..6f49bf1 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,30 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 7, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "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": [ - "# Your code here\n" + "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)" ] } ], "metadata": { "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "Python 3", "language": "python", "name": "python3" }, @@ -126,7 +161,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.13" + "version": "3.13.1" } }, "nbformat": 4,