Commit 5bbe01e1 authored by geobumac's avatar geobumac

Merge branch 'master' into gaspar

# Conflicts:
#	01-DataTypes&ControlFlow.ipynb
#	02-Comprehension&Documentation.ipynb
parents e3367e66 7f305deb
...@@ -24,7 +24,9 @@ ...@@ -24,7 +24,9 @@
"* Interpretado (Se ejecuta sin compilación previa)\n", "* Interpretado (Se ejecuta sin compilación previa)\n",
"* Tipificación Dinamica (Se realiza durante en tiempo de ejecución)\n", "* Tipificación Dinamica (Se realiza durante en tiempo de ejecución)\n",
"* Multiparadigma\n", "* Multiparadigma\n",
"* Interactivo (con ipython)\n" "* Interactivo (con ipython)\n",
"\n",
"*Nota: Python obtiene su nombre del programa de la BBC [Monty Python's Flying Circus](https://www.imdb.com/title/tt0063929/).*"
] ]
}, },
{ {
...@@ -921,7 +923,7 @@ ...@@ -921,7 +923,7 @@
"cell_type": "markdown", "cell_type": "markdown",
"metadata": {}, "metadata": {},
"source": [ "source": [
"### 1.5.5 Escribe una funcion que sume todos los uneros en una lista." "### 1.5.5 Escribe una funcion que sume todos los numeros en una lista usando for."
] ]
}, },
{ {
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 31, "execution_count": 1,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
"[2, 2, 4, 6, 8]" "[2, 2, 4, 6, 8]"
] ]
}, },
"execution_count": 31, "execution_count": 1,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 40, "execution_count": 2,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
"[2, 2, 4, 6, 8]" "[2, 2, 4, 6, 8]"
] ]
}, },
"execution_count": 40, "execution_count": 2,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 38, "execution_count": 3,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
" 9: 387420489}" " 9: 387420489}"
] ]
}, },
"execution_count": 38, "execution_count": 3,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 37, "execution_count": 4,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
"[[1, 0, 0], [0, 1, 0], [0, 0, 1]]" "[[1, 0, 0], [0, 1, 0], [0, 0, 1]]"
] ]
}, },
"execution_count": 37, "execution_count": 4,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
...@@ -114,7 +114,7 @@ ...@@ -114,7 +114,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 2, "execution_count": 34,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
...@@ -123,7 +123,7 @@ ...@@ -123,7 +123,7 @@
"{3, 6, 9}" "{3, 6, 9}"
] ]
}, },
"execution_count": 2, "execution_count": 34,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
...@@ -152,7 +152,7 @@ ...@@ -152,7 +152,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 77, "execution_count": null,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
...@@ -161,7 +161,7 @@ ...@@ -161,7 +161,7 @@
"function" "function"
] ]
}, },
"execution_count": 77, "execution_count": 6,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
...@@ -173,7 +173,7 @@ ...@@ -173,7 +173,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 4, "execution_count": 41,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
...@@ -182,7 +182,7 @@ ...@@ -182,7 +182,7 @@
"[27, 46656, 387420489]" "[27, 46656, 387420489]"
] ]
}, },
"execution_count": 4, "execution_count": 41,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
...@@ -194,7 +194,7 @@ ...@@ -194,7 +194,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 47, "execution_count": null,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
...@@ -203,7 +203,7 @@ ...@@ -203,7 +203,7 @@
"[(13, -3), (4, 1), (1, 2), (9, 10)]" "[(13, -3), (4, 1), (1, 2), (9, 10)]"
] ]
}, },
"execution_count": 47, "execution_count": 8,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
...@@ -216,7 +216,7 @@ ...@@ -216,7 +216,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 51, "execution_count": null,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
...@@ -243,7 +243,7 @@ ...@@ -243,7 +243,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 55, "execution_count": null,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
...@@ -274,7 +274,7 @@ ...@@ -274,7 +274,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 66, "execution_count": null,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
...@@ -299,6 +299,25 @@ ...@@ -299,6 +299,25 @@
"print(list(doublesG))" "print(list(doublesG))"
] ]
}, },
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"a = int(input('Cuatos Fibonacci?: '))\n",
"\n",
"def fib(n):\n",
" a, b = 0, 1\n",
" for _ in range(n):\n",
" yield a\n",
" a, b = b, a + b\n",
"\n",
"sum(fib(a)) \n",
"#for n in fib(a):\n",
"# print(n)"
]
},
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": {}, "metadata": {},
...@@ -310,7 +329,7 @@ ...@@ -310,7 +329,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 3, "execution_count": 67,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
...@@ -339,7 +358,7 @@ ...@@ -339,7 +358,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 25, "execution_count": 69,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
...@@ -369,7 +388,7 @@ ...@@ -369,7 +388,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 27, "execution_count": 72,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
...@@ -440,7 +459,7 @@ ...@@ -440,7 +459,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 4, "execution_count": 74,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
...@@ -469,7 +488,7 @@ ...@@ -469,7 +488,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 34, "execution_count": 76,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
...@@ -499,7 +518,7 @@ ...@@ -499,7 +518,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 39, "execution_count": 78,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
...@@ -565,7 +584,7 @@ ...@@ -565,7 +584,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 80, "execution_count": null,
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
...@@ -589,17 +608,9 @@ ...@@ -589,17 +608,9 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 1, "execution_count": null,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [],
{
"name": "stdout",
"output_type": "stream",
"text": [
"hello\n"
]
}
],
"source": [ "source": [
"from miModulo import helloWorld\n", "from miModulo import helloWorld\n",
"helloWorld.hello()" "helloWorld.hello()"
...@@ -616,50 +627,9 @@ ...@@ -616,50 +627,9 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 89, "execution_count": null,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [],
{
"name": "stdout",
"output_type": "stream",
"text": [
"Generators have a ``Yields`` section instead of a ``Returns`` section.\n",
"\n",
" Args:\n",
" n (int): The upper limit of the range to generate, from 0 to `n` - 1.\n",
"\n",
" Yields:\n",
" int: The next number in the range of 0 to `n` - 1.\n",
"\n",
" Examples:\n",
" Examples should be written in doctest format, and should illustrate how\n",
" to use the function.\n",
"\n",
" >>> print([i for i in example_generator(4)])\n",
" [0, 1, 2, 3]\n",
"\n",
" \n",
"Help on function example_generator in module __main__:\n",
"\n",
"example_generator(n)\n",
" Generators have a ``Yields`` section instead of a ``Returns`` section.\n",
" \n",
" Args:\n",
" n (int): The upper limit of the range to generate, from 0 to `n` - 1.\n",
" \n",
" Yields:\n",
" int: The next number in the range of 0 to `n` - 1.\n",
" \n",
" Examples:\n",
" Examples should be written in doctest format, and should illustrate how\n",
" to use the function.\n",
" \n",
" >>> print([i for i in example_generator(4)])\n",
" [0, 1, 2, 3]\n",
"\n"
]
}
],
"source": [ "source": [
"def example_generator(n):\n", "def example_generator(n):\n",
" \"\"\"Generators have a ``Yields`` section instead of a ``Returns`` section.\n", " \"\"\"Generators have a ``Yields`` section instead of a ``Returns`` section.\n",
...@@ -697,7 +667,7 @@ ...@@ -697,7 +667,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 5, "execution_count": null,
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
...@@ -708,49 +678,9 @@ ...@@ -708,49 +678,9 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 6, "execution_count": null,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [],
{
"data": {
"text/html": [
"\n",
"<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">\n",
"<html><head><title>Python: module helloWorld</title>\n",
"<meta charset=\"utf-8\">\n",
"</head><body bgcolor=\"#f0f0f8\">\n",
"\n",
"<table width=\"100%\" cellspacing=0 cellpadding=2 border=0 summary=\"heading\">\n",
"<tr bgcolor=\"#7799ee\">\n",
"<td valign=bottom>&nbsp;<br>\n",
"<font color=\"#ffffff\" face=\"helvetica, arial\">&nbsp;<br><big><big><strong>helloWorld</strong></big></big></font></td\n",
"><td align=right valign=bottom\n",
"><font color=\"#ffffff\" face=\"helvetica, arial\"><a href=\".\">index</a><br><a href=\"file:/home/mchc/git/tap1012/miModulo/helloWorld.py\">/home/mchc/git/tap1012/miModulo/helloWorld.py</a></font></td></tr></table>\n",
" <p><tt>This&nbsp;example&nbsp;module&nbsp;shows&nbsp;various&nbsp;types&nbsp;of&nbsp;documentation&nbsp;available&nbsp;for&nbsp;use<br>\n",
"with&nbsp;pydoc.&nbsp;&nbsp;To&nbsp;generate&nbsp;HTML&nbsp;documentation&nbsp;for&nbsp;this&nbsp;module&nbsp;issue&nbsp;the<br>\n",
"command:<br>\n",
"&nbsp;<br>\n",
"&nbsp;&nbsp;&nbsp;&nbsp;pydoc&nbsp;-w&nbsp;foo</tt></p>\n",
"<p>\n",
"<table width=\"100%\" cellspacing=0 cellpadding=2 border=0 summary=\"section\">\n",
"<tr bgcolor=\"#eeaa77\">\n",
"<td colspan=3 valign=bottom>&nbsp;<br>\n",
"<font color=\"#ffffff\" face=\"helvetica, arial\"><big><strong>Functions</strong></big></font></td></tr>\n",
" \n",
"<tr><td bgcolor=\"#eeaa77\"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>\n",
"<td width=\"100%\"><dl><dt><a name=\"-hello\"><strong>hello</strong></a>()</dt><dd><tt>Documentacion&nbsp;de&nbsp;función&nbsp;<a href=\"#-hello\">hello</a>()&nbsp;del&nbsp;modulo&nbsp;miModulo.</tt></dd></dl>\n",
"</td></tr></table>\n",
"</body></html>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [ "source": [
"from IPython.display import HTML\n", "from IPython.display import HTML\n",
"HTML(filename=\"miModulo/helloWorld.html\")" "HTML(filename=\"miModulo/helloWorld.html\")"
...@@ -767,7 +697,7 @@ ...@@ -767,7 +697,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 10, "execution_count": 1,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
...@@ -799,7 +729,7 @@ ...@@ -799,7 +729,7 @@
"TestResults(failed=0, attempted=2)" "TestResults(failed=0, attempted=2)"
] ]
}, },
"execution_count": 10, "execution_count": 1,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment