Skip to content
Open
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
49 changes: 41 additions & 8 deletions cfu-data-types.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,43 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 17,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
"<class 'str'>\n",
"\n",
"<class 'str'>\n",
"\n",
"Salary_after_expenses: 800.0\n",
"¿Es menor a 500? False\n",
"Tipo: <class 'bool'>\n"
]
}
],
"source": [
"# Your code here\n"
"name = input(\"¿Cómo te llamas?\")\n",
"print(input(\"¿Cómo te llamas?\"))\n",
"print(type(input(\"¿Cómo te llamas?\")))\n",
"\n",
"Age= input(\"¿Cuántos años tienes?\")\n",
"print(input(\"¿Cuántos años tienes?\"))\n",
"print(type(input(\"¿Cuántos años tienes?\")))\n",
"\n",
"Addres= input(\"Introduce tu dirección\")\n",
"print(input(\"Introduce tu dirección\"))\n",
"\n",
"Salary_after_expenses = input(\"¿Cuanto salario ahorras? \")\n",
"Salary_after_expenses_num = float(Salary_after_expenses)\n",
"es_menor_500 = Salary_after_expenses_num < 500\n",
"\n",
"print(\"Salary_after_expenses:\", Salary_after_expenses_num)\n",
"print(\"¿Es menor a 500?\", es_menor_500)\n",
"print(\"Tipo:\", type(es_menor_500))"
]
},
{
Expand All @@ -80,12 +112,13 @@
"\n",
"- *You can use the len() function to get the length of a string.*\n",
"- *Search string methods to accomplish the other steps. Recommended External Resources: [Python String Methods](https://www.w3schools.com/python/python_ref_string.asp)*\n",
"- *Use method chaining to simplify your code. If you are not sure what it is, read this tutorial before: https://pyneng.readthedocs.io/en/latest/book/04_data_structures/method_chaining.html*\n"
"- *Use method chaining to simplify your code. If you are not sure what it is, read this tutorial before: https://pyneng.readthedocs.io/en/latest/book/04_data_structures/method_chaining.html*\n",
"."
]
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -102,7 +135,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -112,7 +145,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
Expand All @@ -126,7 +159,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.13"
"version": "3.14.4"
}
},
"nbformat": 4,
Expand Down