Skip to content
Open

listo #139

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 44 additions & 9 deletions cfu-data-types.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
},
{
Expand Down Expand Up @@ -85,7 +107,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -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"
},
Expand All @@ -126,7 +161,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.13"
"version": "3.13.1"
}
},
"nbformat": 4,
Expand Down