Skip to content

Commit 0989cc9

Browse files
committed
Agrego funcion
1 parent c0b9e33 commit 0989cc9

2 files changed

Lines changed: 179 additions & 3 deletions

File tree

slides/01.pdf

42.1 KB
Binary file not shown.

slides/01.typ

Lines changed: 179 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#import "@preview/codly:1.3.0": *
33
#import "@preview/codly-languages:0.1.10": *
44
#import "@preview/gentle-clues:1.3.1": *
5+
#import "@preview/pinit:0.2.2": *
56
#import "template.typ": setup-template, new-section-slide
67

78
#show: codly-init.with()
@@ -56,15 +57,17 @@
5657
- Enfocado en R y Python
5758
- Gratis
5859
- Código abierto
59-
- Rstudio ❤️ VS Code
60+
- Rstudio #emoji.heart VS Code
6061
]
6162
][
6263
#set align(center)
6364
#image("positron-icon.svg", width:60%)
6465
]
6566
]
6667

67-
#new-section-slide[A jugar con Python ⏳]
68+
#new-section-slide[A jugar con Python #emoji.laptop]
69+
70+
#new-section-slide[Tipos de datos elementales]
6871

6972
#slide[
7073
= Tipos de datos elementales
@@ -403,9 +406,178 @@
403406
#new-section-slide[Funciones]
404407

405408
#slide[
406-
= Titulo
409+
= ¿Por qué usamos funciones?
410+
411+
#set text(size: 1.4em)
412+
#set list(spacing: 1.4em)
413+
414+
#item-by-item[
415+
- Reutilización de código
416+
- Organización
417+
- Modularidad
418+
]
419+
420+
#uncover("4-")[
421+
#v(5em)
422+
#set align(center)
423+
Nada que ustedes no supieran #emoji.face.wink
424+
]
425+
426+
]
427+
428+
429+
#slide[
430+
#let annotation(body) = {
431+
box(
432+
fill: rgb("#dbeafe"),
433+
inset: 8pt,
434+
radius: 4pt,
435+
stroke: rgb("#555")
436+
)[
437+
#set align(center)
438+
#body
439+
]
440+
}
441+
442+
#show raw: it => {
443+
show regex("pin\d+"): it => pin(eval(it.text.slice(3)))
444+
it
445+
}
446+
447+
#v(7em)
448+
449+
#set align(center)
450+
#show raw.where(block: true): set text(size: 26pt) // Code size
451+
#show raw.where(block: true): it => block(width: 70%, it)
452+
453+
```python
454+
pin1defpin2 pin3funpin4(pin5x, y, zpin6)pin7:pin8
455+
pin9# <cuerpo de la función>pin10
456+
pin11returnpin12 pin13valorpin14
457+
```
458+
459+
#uncover(1)[
460+
#pinit-highlight(1, 2, dy: -1.1em, fill: rgb(0, 0, 255, 50))
461+
462+
#pinit-point-from(
463+
(1, 2),
464+
body-dx: -120pt,
465+
body-dy: -60pt,
466+
offset-dx: 0pt,
467+
offset-dy: -90pt,
468+
pin-dy: -25pt,
469+
pin-dx: 0pt,
470+
)[
471+
#annotation[
472+
Indica comienzo de\
473+
definición de una función
474+
]
475+
]
476+
]
477+
478+
#uncover(2)[
479+
#pinit-highlight(3, 4, dy: -1.1em, fill: rgb(0, 0, 255, 50))
480+
481+
#pinit-point-from(
482+
(3, 4),
483+
body-dx: -70pt,
484+
body-dy: -60pt,
485+
offset-dx: 0pt,
486+
offset-dy: -90pt,
487+
pin-dy: -25pt,
488+
pin-dx: 0pt,
489+
)[
490+
#annotation[
491+
Nombre\
492+
de la función
493+
]
494+
]
495+
]
496+
497+
498+
#uncover(3)[
499+
#pinit-highlight(5, 6, dy: -1.2em, extended-height: 1.6em, fill: rgb(0, 0, 255, 50))
500+
501+
#pinit-point-from(
502+
(5, 6),
503+
body-dx: -70pt,
504+
body-dy: -60pt,
505+
offset-dx: 0pt,
506+
offset-dy: -90pt,
507+
pin-dx: 0pt,
508+
pin-dy: -25pt
509+
)[
510+
#annotation[Argumentos \ de la función]
511+
]
512+
]
513+
514+
#uncover(4)[
515+
#pinit-highlight(7, 8, dy: -1.2em, extended-height: 1.6em, fill: rgb(0, 0, 255, 50))
516+
517+
#pinit-point-from(
518+
(7, 8),
519+
body-dx: -90pt,
520+
body-dy: -60pt,
521+
offset-dx: 0pt,
522+
offset-dy: -90pt,
523+
pin-dx: 0pt,
524+
pin-dy: -25pt
525+
)[
526+
#annotation[Comienza un \ bloque de código]
527+
]
528+
]
529+
530+
#uncover(5)[
531+
#pinit-highlight(9, 10, dy: -1.2em, extended-height: 1.6em, fill: rgb(0, 0, 255, 50))
532+
533+
#pinit-point-from(
534+
9,
535+
body-dx: -120pt,
536+
body-dy: 5pt,
537+
offset-dx: -60pt,
538+
offset-dy: 70pt,
539+
pin-dx: -5pt,
540+
pin-dy: -8pt
541+
)[
542+
#annotation[Código que se ejecuta \ cuando se llama a la función]
543+
]
544+
]
545+
546+
#uncover(6)[
547+
#pinit-highlight(11, 12, dy: -1.2em, extended-height: 1.6em, fill: rgb(0, 0, 255, 50))
548+
549+
#pinit-point-from(
550+
(11, 12),
551+
body-dx: -120pt,
552+
body-dy: 5pt,
553+
offset-dx: 0pt,
554+
offset-dy: 70pt,
555+
pin-dx: 0pt,
556+
pin-dy: 10pt
557+
)[
558+
#annotation[Indica que se devuelve un valor \ y el fin de la ejecución \
559+
de la función]
560+
]
561+
]
562+
563+
#uncover(7)[
564+
#pinit-highlight(13, 14, dy: -1.2em, extended-height: 1.6em, fill: rgb(0, 0, 255, 50))
565+
566+
#pinit-point-from(
567+
(13, 14),
568+
body-dx: -140pt,
569+
body-dy: 5pt,
570+
offset-dx: 0pt,
571+
offset-dy: 70pt,
572+
pin-dx: 0pt,
573+
pin-dy: 10pt
574+
)[
575+
#annotation[Valor que devuelve la función]
576+
]
577+
]
407578
]
408579

580+
409581
#new-section-slide[Ejecución condicional]
410582

411583
#slide[
@@ -417,3 +589,7 @@
417589
#slide[
418590

419591
]
592+
593+
594+
595+

0 commit comments

Comments
 (0)