-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathoperators.html
More file actions
140 lines (113 loc) · 3.75 KB
/
operators.html
File metadata and controls
140 lines (113 loc) · 3.75 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
<!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>Operadores - 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>Operadores - 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>
## Suma, resta, multiplicación y división
En python se pueden realizar todas las operaciones básicas conocidas tales como suma, resta, multiplicación y división.
```python
2 + 3
>>> 4
2 * 3
>>> 6
2 - 3
>>> -1
2 / 3
>>> 0.6666666666666666
```
</textarea>
</section>
<section data-markdown>
<textarea data-template>
## Residuo
El residuo es la parte restante de una division de enteros
```python
2 % 3
>>> 2
5 % 2
>>> 1
```
</textarea>
</section>
<section data-markdown>
<textarea data-template>
## Parte entera de la división
En Python cualquier división siempre devolverá un flotante a pesar de que los inputs sean enteros.
Si por el contrario, lo que se busca es la parte entera, python tiene el operador `//`.
```python
2 // 3
>>> 0
```
</textarea>
</section>
<section data-markdown>
<textarea data-template>
## Potencia
```python
2 ** 3
>>> 8
```
</textarea>
</section>
<section>
<a href="./strings.html">Siguiente: Cadenas</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>