- Notifications
You must be signed in to change notification settings - Fork252
README.es.md for exercices 01 to 10#4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
1 change: 1 addition & 0 deletions.gitignore
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -6,6 +6,7 @@ | ||
!.gitpod.Dockerfile | ||
!bc.json | ||
!README.md | ||
!README.*.md | ||
!/exercises | ||
!/exercises/* | ||
1 change: 1 addition & 0 deletionsREADME.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletionsexercises/01-hello-world/README.es.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Aprende Funciones en Python! | ||
¡¡Nos estusiasma mucho tenerte aquí!! 🎉 😂 | ||
Presiona `Next` `Next →` de arriba a la derecha cuando quieras empezar. | ||
En este curso aprenderás los siguientes conceptos: | ||
1. Cómo crear y llamar Funciones. | ||
2. Construir tus primeras funciones reales | ||
3. Sentirte cómod@ usando Funciones Lambda en Python | ||
4. Construir Funciones con parametros. | ||
5. Ejemplos de la vida real con funciones | ||
## Contributors | ||
Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)): | ||
1. [Alejandro Sanchez (alesanchezr)](https://github.com/alesanchezr), contribution: (coder) :computer: (idea) 🤔, (build-tests) :warning:, (pull-request-review) :eyes: (build-tutorial) :white_check_mark: (documentation) :book: | ||
2. [Paolo (plucodev)](https://github.com/plucodev), contribución: (bug reports) :bug: (coder) :computer:, (traducción) :earth_americas: | ||
3. [Marco Gómez (marcogonzalo)](https://github.com/marcogonzalo), contribución: (bug reports) :bug:, (traducción) :earth_africa: | ||
This project follows the | ||
[all-contributors](https://github.com/kentcdodds/all-contributors) | ||
specification. Contributions of any kind are welcome! |
2 changes: 2 additions & 0 deletionsexercises/01-hello-world/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletionsexercises/02-Hello-World/README.es.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# `02` Hola, Mundo | ||
En Python, usamos `print` para hacer que el computador escriba cualquier cosa que queramos (el contenido de una variable, un texto dado, etc.) in algo llamado `la consola`. | ||
Every language has functions to integrate with the console, as it was the only way to interact with the users at the beginning (before the Windows or MacOS arrived). Today, printing in the console is used mostly as a monitoring tool, ideal to leave a trace of the content of variables during the program execution. | ||
This is an example of how to use it: | ||
```js | ||
print("How are you?") | ||
``` | ||
## 📝 Instructions: | ||
Usa la función `print()` para escribir "Hello World!" en la consola. Siéntete libre de intentar otras cosas también. | ||
## 💡 Ayuda: | ||
Video de 5 minutos sobre la consola: | ||
https://www.youtube.com/watch?v=vROGBvX_MHQ |
24 changes: 24 additions & 0 deletionsexercises/03-What-is-a-function/README.es.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# `03` ¿Qué es una función (function)? | ||
Puedes ver una función como un **fragmento de código** que puedes encapsular entre llaves para poder usarla varias veces. | ||
Por ejemplo, si queremos obtener la suma de dos números, podemos declarar una función llamada `sum` que devuelve la suma de number1 y number2: | ||
```python | ||
def sum(number1,number2): | ||
return number1 + number2 | ||
``` | ||
Después de declarar la función, podemos usarla tantas veces como queramos, así: | ||
```python | ||
total = sum(2,3) | ||
total2 = sum(5,10) | ||
print(total) # prints 5 on the terminal | ||
print(total2) # prints 10 on the terminal | ||
``` | ||
# 📝 Instrucciones | ||
Calcula la suma entre **3445324** y **53454423** y asigna el resultado a una variable llamada `super_duper` |
42 changes: 42 additions & 0 deletionsexercises/04-Call-a-function/README.es.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# `04` Llamando a una función | ||
Una función podría recibir 0 parámetros y tú puedes devolver algo siempre, incluso si no añades explícitamente el `return`. | ||
:point_up: [Presiona aquí para saber más sobre funciones](https://content.breatheco.de/lesson/working-with-functions-python) | ||
Por ejemplo, una función que calcula el área de un cuadrado sería algo como esto: | ||
```python | ||
def calculate_area(length, edge): | ||
return length * edge | ||
``` | ||
Si deseas usar esa función para calcular el área de un cuadrado con | ||
```python | ||
length = 3 | ||
edge = 6 | ||
``` | ||
Necesitas hacer algo como esto: | ||
```python | ||
area = calculate_area(3,6) | ||
# The value of area will be set to 18 | ||
``` | ||
# 📝 Instrucciones: | ||
Crea una nueva variable llamada squareArea para cada nueva iteración de la función CalculateArea utilizando las dimensiones de la figura, por ejemplo, para la primera figura, | ||
```python | ||
# For the first figure: | ||
square_area1 = calculate_area(4,4) | ||
``` | ||
 | ||
# 💡 Sugerencia: | ||
- Llama 3 veces a la función `calculate_area`, una por cada cuadrado, pasando la longitud y el borde de cada cuadrado. | ||
:tv: [Video de 9 min sobre funciones en Python](https://www.youtube.com/watch?v=NE97ylAnrz4) |
43 changes: 43 additions & 0 deletionsexercises/05-Defining-vs-Calling-a-function/README.es.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# `05` Definir vs llamar a una función | ||
Las funciones solo existirán si usted u otra persona las define ... es la única forma en que el compilador/intérprete de idiomas sabe que existen, por lo tanto, puede ejecutarlas cuando las llama. | ||
Para definir una función necesitamos escribir esta fórmula básica de código: | ||
```python | ||
def myFunctionName(parameter, parameter2, ...parameterX): | ||
# the function code here | ||
return something | ||
``` | ||
La palabra `def` es una palabra reservada en Python, esto significa que solo se usa para definir una función. | ||
**El nombre** de la función podría ser lo que quieras. Consejo: usa un nombre descriptivo (no intentes ahorrar palabras, usa tantas como necesites) de esta manera entenderás lo que hace la función -y lo que devuelve-. | ||
Nombres de ejemplo: add_two_integers , calculate_taxes , get_random_number, etc. | ||
**Parámetros:** puedes definir tantos parámetros como desees, más aún, si los necesitas. La cantidad de parámetros dependerá de las operaciones realizadas dentro de la función. Ejemplo: si la función está agregando dos enteros (3 + 4), esto significa que la función necesitará dos parámetros (uno para cada entero). | ||
**Alcance:** Todas las operaciones que realizará la función deben estar dentro de `{` `}` (llaves). Cualquier cosa por fuera, no se considerará como parte de la función. Esto se llama **el alcance** (scope), y podría ser local (dentro de la función) y global (fuera de la función). | ||
**El retorno**: no todas las funciones necesitan devolver algo, pero se recomienda que lo haga. | ||
Consejo: devolviendo `None` es un buen valor por defecto para cuando, aún, no sabes si se necesita devolver algo. | ||
Ejemplo de una función: | ||
```python | ||
def concatenate_number_to_string(local_number, local_string): | ||
local_variable = local_string+""+str(local_number) | ||
return local_variable | ||
``` | ||
# 📝 Instrucciones: | ||
1. Define una función llamada "multi". | ||
2. La función múltiple recibe dos números | ||
3. Devuelve el resultado de la multiplicación entre ellos. | ||
# 💡 Pista: | ||
Recuerda agregar la línea de `return`. Cada función debe devolver algo. En este caso debería ser el resultado de la multiplicación. |
33 changes: 33 additions & 0 deletionsexercises/06-lambda-functions/README.es.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# `06` Funciones Lambda en Python | ||
Una función lambda es una función con solo una línea de código y sin nombre. | ||
Es un tipo de función muy especial en el mundo Python porque puedes usarla como una pequeña utilidad para una programación muy ágil: | ||
```python | ||
# declaring a normal funcion for multiplication | ||
def multiply(p1, p2): | ||
return p1 * p2 | ||
# declaring it now like a one line lambda | ||
multiply = lambda p1,p2: p1 * p2 | ||
``` | ||
1. Las funciones lambda tiene que ser siempre muy pequeñas | ||
2. Las funciones lambda pueden tener únicamente una línea | ||
3. Las funciones lambda no necesitan un `return`, se asume que lo que haya en esa línea devolverá un valor. | ||
4. Las funciones lambda can be stored in variables or passed as parameters to another function | ||
# 📝 Instrucciones: | ||
1. Crea una variable llamada `is_odd` | ||
2. Asígnale una función lambda que devuelva True o False dependiendo de si un número dado es impar o no | ||
## 💡 Ayuda: | ||
Así es como declararías una función normal | ||
```python | ||
# this function return True if a number is odd. | ||
def is_odd(num): | ||
return (num % 2) == 0: | ||
``` |
18 changes: 18 additions & 0 deletionsexercises/07-lambda-function-two/README.es.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# `07` Funciones Lambda | ||
Apunta y toma nota | ||
Las funciones Lambda permiten una sintaxis corta para escribir expresiones de funciones. | ||
```python | ||
multy = lambda x, y: x * y | ||
print(multy(2,2)) | ||
``` | ||
# 📝 Instrucciones: | ||
1. Crea una función lambda llamada `rapid` que tendrá un parámetro de string | ||
2. Devuelve el mismo string pero eliminándole la última letra | ||
# 💡 Sugerencia | ||
Busca en Google "remove last letter form string python" (puedes usar los corchetes) |
18 changes: 18 additions & 0 deletionsexercises/08-Function-that-returns/README.es.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# `08` Funciones que devuelven | ||
Es una muy buena práctica que las funciones devuelvan algo, incluso si es `None` si tus funciones devuelven algo, puedes crear algoritmos que usen muchas funciones al mismo tiempo. Por ejemplo, en este caso en particular tenemos dos funciones disponibles: | ||
```md | ||
dollar_to_euro: que calcula el valor en euros de un valor dado en dólares. | ||
euro_to_yen: calcula el valor en yenes de un valor dado en euros. | ||
``` | ||
# 📝 Instrucciones: | ||
Utilizando las dos funciones disponibles, imprima en la consola el valor de 137 dólares en yenes. | ||
# 💡 Ayuda | ||
Trabajando al revés: | ||
- Nuestro valor esperado está en yenes. | ||
- Nuestra función disponible euro_to_yen proporcionará eso | ||
- Para llegar al euro utilizaremos la función disponible dollar_to_euro. |
15 changes: 15 additions & 0 deletionsexercises/09-Function-parameters/README.es.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# `09` Parámetros de funciones | ||
Puedes especificar tantos parámetros como desees en una función. Como desarrollador/a, encontrarás funciones con, incluso, 6 o 7 parámetros todo el tiempo. Los nombres de los parámetros no importan, pero debe ser lo más explícito posible porque esos nombres darán pistas a los otros desarrolladores (o a ti en el futuro) sobre de qué se trata cada parámetro. | ||
# 📝 Instrucciones: | ||
- Escribe la función "render_person" requerida para imprimir un string como el siguiente: | ||
```md | ||
Bob is a 23 years old male born in 05/22/1983 with green eyes | ||
``` | ||
# 💡 Pista | ||
- Tienes que hacer una concatenación de string y devolver ese string. |
13 changes: 13 additions & 0 deletionsexercises/10-Array-Methods/README.es.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# `10` Métodos de listas | ||
# 📝 Instrucciones: | ||
- Escribe una función llamada sort_names que dada una lista de nombres, los devuelva en orden alfabético. | ||
# 💡 Pista | ||
- Cada lista viene con funciones predeterminadas que permiten la ordenación, ¡úsalas dentro de tu función! | ||
¿Atrapado en el ordenamiento? Lee la página de W3 Schools sobre ordenar los listas: | ||
https://www.w3schools.com/python/ref_list_sort.asp |
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.