-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathblocks.html
More file actions
142 lines (114 loc) · 3.98 KB
/
blocks.html
File metadata and controls
142 lines (114 loc) · 3.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>Bloques - Python 101</title>
<link rel="stylesheet" href="reveal.js/css/reveal.css">
<link rel="stylesheet" href="reveal.js/css/theme/white.css">
<!-- Theme used for syntax highlighting of code -->
<link rel="stylesheet" href="reveal.js/lib/css/zenburn.css">
<!-- Printing and PDF exports -->
<script>
var link = document.createElement( 'link' );
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = window.location.search.match( /print-pdf/gi ) ? 'reveal.js/css/print/pdf.css' : 'reveal.js/css/print/paper.css';
document.getElementsByTagName( 'head' )[0].appendChild( link );
</script>
</head>
<body>
<div class="reveal">
<!-- Any section element inside of this container is displayed as a slide -->
<div class="slides">
<section>
<h1>Bloques - Python 101</h1>
<p>
<small>Por <a href="https://michelletorres.mx/acerca">Michelle Torres</a> / <a href="http://twitter.com/nmicht">@nmicht</a></small>
</p>
</section>
<section data-markdown>
<textarea data-template>
# Bloques
En python los bloques de códigos se definen por espacios y no hay necesidad de llaves.
```python
# Secuencia Fibonacci
a, b = 0, 1
while(a < 10):
print(a)
a, b = b, a+b
```
</textarea>
</section>
<section data-markdown>
<textarea data-template>
```python
# Secuencia Fibonacci
a, b = 0, 1
while(a < 10):
print(a)
a, b = b, a+b
```
En este ejemplo, el bloque inicia con `:` y el contenido del bloque esta indentado.
</textarea>
</section>
<section data-markdown>
<textarea data-template>
En caso se que se requiera código después del bloque se agrega una línea en blanco.
```python
# Secuencia Fibonacci
a, b = 0, 1
while(a < 10):
print(a)
a, b = b, a+b
print('Termina el programa')
```
</textarea>
</section>
<section data-markdown>
<textarea data-template>
# Pass
Cuando se requiere tener bloques de código vacios, podemos usar `pass`.
Esto es común cuando estamos armando funciones, condiciones, etc, pero aún no pondremos código, y usamos un pass para no olvidar que ahí debemos poner código mas adelante.
```python
while True:
pass
```
</textarea>
</section>
<section>
<a href="./operators.html">Siguiente: Operadores</a>
</section>
<section>
<h1>GRACIAS</h1>
<h3>Contáctame</h3>
<ul>
<li>hola@michelletorres.mx</li>
<li>@nmicht</li>
<li>https://michelletorres.mx</li>
</ul>
<p>
<small>Por <a href="https://michelletorres.mx/acerca">Michelle Torres</a> / <a href="http://twitter.com/nmicht">@nmicht</a></small>
</p>
</section>
</div>
</div>
<script src="reveal.js/lib/js/head.min.js"></script>
<script src="reveal.js/js/reveal.js"></script>
<script>
// More info about config & dependencies:
// - https://github.com/hakimel/reveal.js#configuration
// - https://github.com/hakimel/reveal.js#dependencies
Reveal.initialize({
controls: true,
slideNumber: false,
dependencies: [
{ src: 'reveal.js/plugin/markdown/marked.js' },
{ src: 'reveal.js/plugin/markdown/markdown.js' },
{ src: 'reveal.js/plugin/notes/notes.js', async: true },
{ src: 'reveal.js/plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } }
]
});
</script>
</body>
</html>