Skip to content

Commit

Permalink
cambios hasta 3 del M04
Browse files Browse the repository at this point in the history
  • Loading branch information
Fran297 committed Mar 18, 2024
1 parent 5d19c4b commit a30a308
Show file tree
Hide file tree
Showing 2 changed files with 106 additions and 15 deletions.
37 changes: 32 additions & 5 deletions M04_flujosdecontrol/Prep_Course_Homework_04-Resuelto.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 1,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -133,9 +133,36 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"El numero 1 es impar\n",
"El numero 2 es par\n",
"El numero 3 es impar\n",
"El numero 4 es par\n",
"El numero 5 es impar\n",
"El numero 6 es par\n",
"El numero 7 es impar\n",
"El numero 8 es par\n",
"El numero 9 es impar\n",
"El numero 10 es par\n",
"El numero 11 es impar\n",
"El numero 12 es par\n",
"El numero 13 es impar\n",
"El numero 14 es par\n",
"El numero 15 es impar\n",
"El numero 16 es par\n",
"El numero 17 es impar\n",
"El numero 18 es par\n",
"El numero 19 es impar\n",
"El numero 20 es par\n"
]
}
],
"source": [
"# resuelto con while\n",
"\n",
Expand Down Expand Up @@ -189,7 +216,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 2,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -996,7 +1023,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.11"
"version": "3.12.2"
}
},
"nbformat": 4,
Expand Down
84 changes: 74 additions & 10 deletions M04_flujosdecontrol/Prep_Course_Homework_04.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,26 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": []
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Menor a cero\n"
]
}
],
"source": [
"x= -68\n",
"if x>0:\n",
" print('Mayor a cero')\n",
"elif x<0:\n",
" print('Menor a cero')\n",
"else:\n",
" print('Igual a cero')"
]
},
{
"attachments": {},
Expand All @@ -33,10 +49,25 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 20,
"metadata": {},
"outputs": [],
"source": []
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Las variables son del mismo tipo de dato: <class 'str'>\n"
]
}
],
"source": [
"var1 = \"2.1\"\n",
"var2 = \"Dos\"\n",
"if (type(var1) == type(var2)):\n",
" print(\"Las variables son del mismo tipo de dato:\", type(var1))\n",
"else:\n",
" print(\"Las variables son de tipos de datos diferentes.\")"
]
},
{
"attachments": {},
Expand All @@ -48,10 +79,43 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 22,
"metadata": {},
"outputs": [],
"source": []
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"1 es impar\n",
"2 es par\n",
"3 es impar\n",
"4 es par\n",
"5 es impar\n",
"6 es par\n",
"7 es impar\n",
"8 es par\n",
"9 es impar\n",
"10 es par\n",
"11 es impar\n",
"12 es par\n",
"13 es impar\n",
"14 es par\n",
"15 es impar\n",
"16 es par\n",
"17 es impar\n",
"18 es par\n",
"19 es impar\n",
"20 es par\n"
]
}
],
"source": [
"for i in range(1,21):\n",
" if i % 2 == 0:\n",
" print(i, 'es par')\n",
" else:\n",
" print(i,'es impar')"
]
},
{
"attachments": {},
Expand Down Expand Up @@ -238,7 +302,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.6"
"version": "3.12.2"
}
},
"nbformat": 4,
Expand Down

0 comments on commit a30a308

Please sign in to comment.