Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 7b21f0d

Browse files
Merge pull request #51 from Lorenagubaira/python.ex10-19
10.1-19 README ́s were changed
2 parents cbe3e63 + fd6b40f commit 7b21f0d

File tree

24 files changed

+169
-189
lines changed

24 files changed

+169
-189
lines changed
Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,19 @@
1-
# `10.1` Creando tu primera función
2-
1+
# `10.1` Creating Your First Function
32

43
## 📝 Instrucciones:
54

65
1. La función `add_numbers` debería devolver la suma de 2 números dados. Por favor, completa el código necesario dentro de la función para hacer que se comporte como se espera.
76

8-
## Resultado esperado:
9-
10-
El ejercicio debería escribir el número 7 en la cónsola.
7+
2. Resultado esperado: el ejercicio debería escribir el número 7 en la cónsola.
118

129
## 💡 Pista:
1310

1411
+ Hay una función `add_numbers` ya declarada, que está recibiendo dos parámetros
1512
(las variables `a` y `b`). Tú debes completar el contenido de la función con el código requerido para sumar la variable `a` con la variable `b` y devolver el resultado de la operación.
1613

17-
## :mag_right: Importante:
18-
19-
+ Para practicar con más funciones, 4Geeks Academy tiene más de 20 ejercicios que incrementan en dificultad [aquí](https://github.com/4GeeksAcademy/python-functions-programming-exercises),
20-
(luego..¡Regresa! :smiley:).
14+
## 🔎 Importante:
2115

16+
+ Para practicar con más funciones, 4Geeks Academy tiene más de 20 ejercicios que se incrementan en dificultad: [https://github.com/4GeeksAcademy/python-functions-programming-exercises](https://github.com/4GeeksAcademy/python-functions-programming-exercises).
2217

18+
¡Inténtalos, y luego regresa!😃
2319

‎exercises/10.1-Creating-Your-First-Function/README.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ tutorial: "https://www.youtube.com/watch?v=K0aDrl41SnQ"
99
1. The function `add_numbers` is supposed to return the sum of 2 given numbers, please
1010
complete the needed code inside of the function to make it behave as expected.
1111

12-
## Expected Result:
13-
14-
The exercise should print the number 7 in the console.
12+
2. Expected Result: the exercise should print the number 7 in the console.
1513

1614
## 💡 Hint:
1715

@@ -20,9 +18,8 @@ The exercise should print the number 7 in the console.
2018
function content with the code needed to sum variable `a` with variable `b` and
2119
return the result of that operation.
2220

23-
## :mag_right: Important:
24-
25-
For practicing more with functions, 4Geeks Academy has more than 20 incremental exercises [here](https://github.com/4GeeksAcademy/python-functions-programming-exercises).
26-
You should those first and then....come back! :smiley:
21+
## 🔎 Important:
2722

23+
For practicing with more functions, 4Geeks Academy has more than 20 exercises that increase in difficulty: [https://github.com/4GeeksAcademy/python-functions-programming-exercises](https://github.com/4GeeksAcademy/python-functions-programming-exercises).
2824

25+
Try them, and then come back!😃
Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
# `11` Crear una nueva función
1+
# `11` Create a New Function
22

3-
Como sabes, las funciones son un bloque de código útil que puedes reutilizar tantas veces como necesites o quieras. En el último ejercicio, tenías una función que recibía dos parámetros
3+
Como sabes, las funciones son un bloque de código útil que puedes reusar tantas veces como necesites.
4+
5+
En el último ejercicio, tenías una función que recibía dos parámetros
46
(dos entradas) y devolvía la suma de ellos. Así:
57

68
```py
79
def add_numbers(a, b):
810
print(a + b)
911
```
1012

11-
Pero Python viene con un conjunto de funciones "pre-definidas" que puedas usar, por ejemplo:
13+
Pero Python viene con un conjunto de funciones "pre-definidas" que puedes usar, por ejemplo:
1214

1315
```py
1416
import random
@@ -18,20 +20,18 @@ r1 = random.randint(0, 10)
1820
print("Random number between 0 and 10 is % s" % (r1))
1921
```
2022

21-
Puedes usar la función `randint()` para obtener un número decimal aleatorio. `Randint()` es una función incorporada del módulo **random** en Python3.
22-
El **módulo random** te da acceso a varias funciones útiles y una de ellas, `randint()`. es capaz de generar números aleatorios,
23-
24-
## 📝 Instrucciones:
23+
Puedes usar la función `randint()` para obtener un número decimal aleatorio. Esta es una función incorporada del **módulo random** en Python3.
2524

26-
1. Por favor, ahora, crea una función llamada `generate_random` que imprima Y devuelva un número
27-
aleatorio entre 0 y 9 cada vez que le llame.
25+
El **módulo random** te da acceso a varias funciones útiles y una de ellas es, `randint()`, capaz de generar números aleatorios.
2826

29-
## 💡 Pista:
27+
## 📝 Instrucciones:
3028

31-
- Una posible solución involucra el uso de dos funciones predefinidas: las funciones `randint` o `randrange`.
29+
1. Por favor, ahora crea una función llamada `generate_random` que imprima y devuelva un número aleatorio entre 0 y 9 cada vez que le llame.
3230

33-
- No olvides importar el **módulo random**.
31+
## 💡 Pistas:
3432

35-
- Puedes consultar la documentación en: https://docs.python.org/3/library/random.html#functions-for-integers
33+
+ Una posible solución involucra el uso de dos funciones predefinidas: las funciones `randint` o `randrange`.
3634

35+
+ No olvides importar el **módulo random**.
3736

37+
+ Puedes consultar la documentación en: https://docs.python.org/3/library/random.html#functions-for-integers

‎exercises/11-Create-A-New-Function/README.md

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,11 @@ tutorial: "https://www.youtube.com/watch?v=XazswkTqKJI"
44

55
# `11` Create a New Function
66

7-
As you know, functions are a useful block of code that you can re-use as many times as you need or want. In the last exercise, you had a function that received two parameters (two inputs) and returned the sum of those. Like this:
7+
As you know, functions are a useful block of code that you can re-use as many times as you need. In the last exercise, you had a function that received two parameters (two inputs) and returned the sum of those. Like this:
88

99
```py
1010
def add_numbers(a, b):
1111
print(a + b)
12-
13-
1412
```
1513

1614
But Python comes with a bunch of "pre-defined" functions that you can use, for example:
@@ -23,19 +21,18 @@ r1 = random.randint(0, 10)
2321
print("Random number between 0 and 10 is % s" % (r1))
2422
```
2523

26-
You can use the `randint()` function to get a random decimal number. `Randint()` is an inbuilt function of the **random module** in Python3. The random module gives access to various useful functions and one of them being able to generate random numbers, which is `randint()`.
24+
You can use the `randint()` function to get a random decimal number. `Randint()` is an inbuilt function of the **random module** in Python3.
2725

28-
## 📝 Instructions:
26+
The **random module** gives access to various useful functions and one of them being able to generate random numbers, which is `randint()`.
2927

30-
1. Please now create a function called `generate_random` that prints AND returns a random number
31-
between 0 and 9 every time it is called.
32-
33-
## 💡 Hint:
28+
## 📝 Instructions:
3429

35-
- One possible solution involves using two predefined functions: the `randint()` or `randrange()` function.
30+
1. Please now create a function called `generate_random` that prints and returns a random number between 0 and 9 every time it is called.
3631

37-
- Don't forget to import the **random module**.
32+
## 💡 Hints:
3833

39-
- Check the documentation: https://docs.python.org/3/library/random.html#functions-for-integers
34+
+ One possible solution involves using two predefined functions: the `randint()` or `randrange()` function.
4035

36+
+ Don't forget to import the **random module**.
4137

38+
+ You can check the documentation here: https://docs.python.org/3/library/random.html#functions-for-integers

‎exercises/12-Rand-From-One-to-Six/README.es.md

Lines changed: 0 additions & 15 deletions
This file was deleted.

‎exercises/12-Rand-From-One-to-Six/README.md

Lines changed: 0 additions & 18 deletions
This file was deleted.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# `12` Rand From One to Twelve
2+
3+
## 📝 Instrucciones:
4+
5+
1. Cambia lo que necesites cambiar para hacer que el algoritmo imprima números enteros aleatorios entre 1 y 12.
6+
7+
2. Esta vez, utiliza la función `randrange()`.
8+
9+
## 💡 Pistas:
10+
11+
+ Debería imprimir números entre 1 y 12, no entre 0 y 12.
12+
13+
+ Este ejercicio es super simple, no te compliques!😃
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
tutorial: "https://www.youtube.com/watch?v=EdyMlVlNUT0"
3+
---
4+
5+
# `12` Rand From One to Twelve
6+
7+
## 📝 Instructions:
8+
9+
1. Change whatever you need to change to make the algorithm print random integers between 1 and 12.
10+
11+
2. This time use `randrange()`function.
12+
13+
## 💡 Hints:
14+
15+
+ It should print between 1 and 12, not between 0 and 12.
16+
17+
+ This exercise is super simple, don't complicate yourself!😃
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /