Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
tap1012
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mario Chirinos Colunga
tap1012
Commits
b7f502f0
Commit
b7f502f0
authored
Jan 31, 2019
by
Mario Chirinos Colunga
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
opp
parent
34d13754
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
360 additions
and
157 deletions
+360
-157
01-DataTypes&ControlFlow.ipynb
01-DataTypes&ControlFlow.ipynb
+5
-3
02-Comprehension&Documentation.ipynb
02-Comprehension&Documentation.ipynb
+54
-124
03-POO.ipynb
03-POO.ipynb
+301
-30
No files found.
01-DataTypes&ControlFlow.ipynb
View file @
b7f502f0
...
...
@@ -24,7 +24,9 @@
"* Interpretado (Se ejecuta sin compilación previa)\n",
"* Tipificación Dinamica (Se realiza durante en tiempo de ejecución)\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/).*"
]
},
{
...
...
@@ -834,7 +836,7 @@
"cell_type": "markdown",
"metadata": {},
"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
."
]
},
{
...
...
@@ -911,7 +913,7 @@
"def pascal(n):\n",
" pass\n",
"numero = input(\"Indica el numero de filas:\")\n",
"pascal(numero)"
"pascal(numero)
\n
"
]
},
{
...
...
02-Comprehension&Documentation.ipynb
View file @
b7f502f0
...
...
@@ -16,7 +16,7 @@
},
{
"cell_type": "code",
"execution_count":
3
1,
"execution_count": 1,
"metadata": {},
"outputs": [
{
...
...
@@ -25,7 +25,7 @@
"[2, 2, 4, 6, 8]"
]
},
"execution_count":
3
1,
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -41,7 +41,7 @@
},
{
"cell_type": "code",
"execution_count":
40
,
"execution_count":
2
,
"metadata": {},
"outputs": [
{
...
...
@@ -50,7 +50,7 @@
"[2, 2, 4, 6, 8]"
]
},
"execution_count":
40
,
"execution_count":
2
,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -63,7 +63,7 @@
},
{
"cell_type": "code",
"execution_count": 3
8
,
"execution_count": 3,
"metadata": {},
"outputs": [
{
...
...
@@ -81,7 +81,7 @@
" 9: 387420489}"
]
},
"execution_count": 3
8
,
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -93,7 +93,7 @@
},
{
"cell_type": "code",
"execution_count":
37
,
"execution_count":
4
,
"metadata": {},
"outputs": [
{
...
...
@@ -102,7 +102,7 @@
"[[1, 0, 0], [0, 1, 0], [0, 0, 1]]"
]
},
"execution_count":
37
,
"execution_count":
4
,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -114,7 +114,7 @@
},
{
"cell_type": "code",
"execution_count":
34
,
"execution_count":
null
,
"metadata": {},
"outputs": [
{
...
...
@@ -123,7 +123,7 @@
"{1, 2, 3, 4, 5, 6, 7, 8, 9}"
]
},
"execution_count":
34
,
"execution_count":
5
,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -151,7 +151,7 @@
},
{
"cell_type": "code",
"execution_count":
77
,
"execution_count":
null
,
"metadata": {},
"outputs": [
{
...
...
@@ -160,7 +160,7 @@
"function"
]
},
"execution_count":
77
,
"execution_count":
6
,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -172,7 +172,7 @@
},
{
"cell_type": "code",
"execution_count":
41
,
"execution_count":
null
,
"metadata": {},
"outputs": [
{
...
...
@@ -181,7 +181,7 @@
"[4, 4, 256, 46656, 16777216]"
]
},
"execution_count":
41
,
"execution_count":
7
,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -192,7 +192,7 @@
},
{
"cell_type": "code",
"execution_count":
47
,
"execution_count":
null
,
"metadata": {},
"outputs": [
{
...
...
@@ -201,7 +201,7 @@
"[(13, -3), (4, 1), (1, 2), (9, 10)]"
]
},
"execution_count":
47
,
"execution_count":
8
,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -214,7 +214,7 @@
},
{
"cell_type": "code",
"execution_count":
51
,
"execution_count":
null
,
"metadata": {},
"outputs": [
{
...
...
@@ -241,7 +241,7 @@
},
{
"cell_type": "code",
"execution_count":
55
,
"execution_count":
null
,
"metadata": {},
"outputs": [
{
...
...
@@ -272,7 +272,7 @@
},
{
"cell_type": "code",
"
execution_count
"
:
66
,
"execution_count":
null
,
"metadata": {},
"outputs": [
{
...
...
@@ -297,6 +297,25 @@
"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",
"metadata": {},
...
...
@@ -308,7 +327,7 @@
},
{
"cell_type": "code",
"
execution_count
"
:
67
,
"execution_count":
null
,
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -325,7 +344,7 @@
},
{
"cell_type": "code",
"
execution_count
"
:
69
,
"execution_count":
null
,
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -342,7 +361,7 @@
},
{
"cell_type": "code",
"
execution_count
"
:
72
,
"execution_count":
null
,
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -360,7 +379,7 @@
},
{
"cell_type": "code",
"
execution_count
"
:
74
,
"execution_count":
null
,
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -377,7 +396,7 @@
},
{
"cell_type": "code",
"
execution_count
"
:
76
,
"execution_count":
null
,
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -394,7 +413,7 @@
},
{
"cell_type": "code",
"
execution_count
"
:
78
,
"execution_count":
null
,
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -423,7 +442,7 @@
},
{
"cell_type": "code",
"
execution_count
"
:
80
,
"execution_count":
null
,
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -447,17 +466,9 @@
},
{
"cell_type": "code",
"
execution_count
"
:
1
,
"execution_count":
null
,
"metadata": {},
"
outputs
"
:
[
{
"
name
"
:
"
stdout
",
"
output_type
"
:
"
stream
",
"
text
"
:
[
"
hello
\
n
"
]
}
],
"outputs": [],
"source": [
"from miModulo import helloWorld\n",
"helloWorld.hello()"
...
...
@@ -474,50 +485,9 @@
},
{
"cell_type": "code",
"
execution_count
"
:
89
,
"execution_count":
null
,
"metadata": {},
"
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"
]
}
],
"outputs": [],
"source": [
"def example_generator(n):\n",
" \"\"\"Generators have a ``Yields`` section instead of a ``Returns`` section.\n",
...
...
@@ -555,7 +525,7 @@
},
{
"cell_type": "code",
"execution_count":
5
,
"execution_count":
null
,
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -566,49 +536,9 @@
},
{
"cell_type": "code",
"execution_count":
6
,
"execution_count":
null
,
"metadata": {},
"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
>
<br>
\n",
"
<font
color=
\"#ffffff\"
face=
\"helvetica,
arial
\"
>
<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
example
module
shows
various
types
of
documentation
available
for
use
<br>
\n",
"with
pydoc.
To
generate
HTML
documentation
for
this
module
issue
the
<br>
\n",
"command:
<br>
\n",
"
<br>
\n",
"
pydoc
-w
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
>
<br>
\n",
"
<font
color=
\"#ffffff\"
face=
\"helvetica,
arial
\"
><big><strong>
Functions
</strong></big></font></td></tr>
\n",
" \n",
"
<tr><td
bgcolor=
\"#eeaa77\"
><tt>
</tt></td><td>
</td>
\n",
"
<td
width=
\"100%\"
><dl><dt><a
name=
\"-hello\"
><strong>
hello
</strong></a>
()
</dt><dd><tt>
Documentacion
de
función
<a
href=
\"#-hello\"
>
hello
</a>
()
del
modulo
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"
}
],
"outputs": [],
"source": [
"from IPython.display import HTML\n",
"HTML(filename=\"miModulo/helloWorld.html\")"
...
...
@@ -625,7 +555,7 @@
},
{
"cell_type": "code",
"execution_count": 1
0
,
"execution_count": 1,
"metadata": {},
"outputs": [
{
...
...
@@ -657,7 +587,7 @@
"TestResults(failed=0, attempted=2)"
]
},
"execution_count": 1
0
,
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
...
...
03-POO.ipynb
View file @
b7f502f0
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment