From bd1cc16fd619e5b4d7a2752ea26f9950016dbdd0 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 11:40:11 +0100 Subject: [PATCH 001/105] Update README.md --- exercises/05-User-Inputed-Values/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/05-User-Inputed-Values/README.md b/exercises/05-User-Inputed-Values/README.md index 49cb46b8..364fc56a 100644 --- a/exercises/05-User-Inputed-Values/README.md +++ b/exercises/05-User-Inputed-Values/README.md @@ -12,8 +12,8 @@ For example, the application right now is prompting the user for its age, and th 1. Please add 10 years to the value of the age variable. -## 💡Hint +## 💡 Hints: -+ You can Google "how to add a number to a python variable". ++ You can Google "how to add a number to a Python variable". -+ Remember that the content of the variable its being previously filled with whatever the user inputs. \ No newline at end of file ++ Remember that the content of the variable is being previously filled with whatever the user inputs. From 84a73ae5686a3e07b2923336e70f95c1bd6ffca2 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 11:41:18 +0100 Subject: [PATCH 002/105] Update README.es.md --- exercises/05-User-Inputed-Values/README.es.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/05-User-Inputed-Values/README.es.md b/exercises/05-User-Inputed-Values/README.es.md index ede34ffc..ecbbf140 100644 --- a/exercises/05-User-Inputed-Values/README.es.md +++ b/exercises/05-User-Inputed-Values/README.es.md @@ -2,14 +2,14 @@ Otra cosa genial de las variables es que no necesitas saber su valor para poder trabajar con ellas. -Por ejemplo, justo ahora la aplicación está preguntando la edad del usuario, y luego la imprime en la cónsola. +Por ejemplo, justo ahora la aplicación está preguntando la edad del usuario, y luego la imprime en la consola. ## 📝 Instrucciones: 1. Por favor, añade 10 años al valor de la variable `age`. -## 💡 Pista: +## 💡 Pistas: + Puedes buscar en Google "Como sumarle una cantidad a una variable de Python". -+ Recuerda que el contenido de la variable está siendo definido con lo que sea que el usuario coloque. \ No newline at end of file ++ Recuerda que el contenido de la variable está siendo definido con lo que sea que el usuario coloque. From 61d013a28e6b769d2214498968324b56dea1ce1e Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 11:42:52 +0100 Subject: [PATCH 003/105] Update test.py --- exercises/05-User-Inputed-Values/test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/05-User-Inputed-Values/test.py b/exercises/05-User-Inputed-Values/test.py index 2a660472..7409b8f8 100644 --- a/exercises/05-User-Inputed-Values/test.py +++ b/exercises/05-User-Inputed-Values/test.py @@ -9,7 +9,7 @@ def test_for_file_output(capsys): regex = re.compile(pattern) assert bool(regex.search(content)) == True -@pytest.mark.it("We tried with age 50 and it was supposed to return 60") +@pytest.mark.it("Testing with age 50 and it is supposed to return 60") @mock.patch('builtins.input', lambda x: 50) def test_plus_ten(stdin): # f = open(os.path.dirname(os.path.abspath(__file__))+'/app.py') From 8f23d1b667de840faaef656fa87b669980f01fb4 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 11:53:14 +0100 Subject: [PATCH 004/105] Update README.md --- exercises/06-String-Concatenation/README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/exercises/06-String-Concatenation/README.md b/exercises/06-String-Concatenation/README.md index 7bf0f55a..541ec12f 100644 --- a/exercises/06-String-Concatenation/README.md +++ b/exercises/06-String-Concatenation/README.md @@ -11,16 +11,15 @@ You can think of this process as similar to connecting two or more train cars. I In Python, you can concatenate, or join together, two or more strings using the `+` operator. This is how it works: ```py - one = 'a' two = 'b' -print(one + two) # this will print 'ab' on the console. +print(one + two) # This will print 'ab' on the console. ``` Here, the variables `one` and `two` hold the individual strings `'a'` and `'b'`. When you use the `+` operator between them, it acts like a glue, sticking the strings together end-to-end. In this case, it joins `'a'` and `'b'`, resulting in the concatenated string `'ab'`, which gets printed to the console. ## 📝 Instructions: -1. Set the values for `my_var1` and `my_var2` so that when concatenated, the code prints `Hello World` in the console. +1. Set the values for `my_var1` and `my_var2` so that, when concatenated, the code prints `Hello World` in the console. ## 💡 Hint: -+ If you need further explanation on how string **concatenation** works in python, you can watch this clip: https://www.youtube.com/watch?v=28FUVmWU_fA&ab_channel=PortfolioCourses (`ctrl + click` on the link to open the video) ++ If you need further explanation on how string **concatenation** works in Python, you can watch this clip: https://www.youtube.com/watch?v=28FUVmWU_fA&ab_channel=PortfolioCourses (`ctrl + click` on the link to open the video) From 42e0a9624c618e751353ca1db26740c3c4322ab2 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 11:56:43 +0100 Subject: [PATCH 005/105] Update README.es.md --- exercises/06-String-Concatenation/README.es.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/exercises/06-String-Concatenation/README.es.md b/exercises/06-String-Concatenation/README.es.md index 382ed1b7..56b080d2 100644 --- a/exercises/06-String-Concatenation/README.es.md +++ b/exercises/06-String-Concatenation/README.es.md @@ -7,10 +7,9 @@ Puedes pensar en este proceso como conectar dos o más vagones de tren. Si cada En Python, puedes concatenar o unir dos o más strings usando el operador `+`. Así es como funciona: ```py - one = 'a' two = 'b' -print(one + two) # esto imprimirá 'ab' en la consola. +print(one + two) # Esto imprimirá 'ab' en la consola. ``` Aquí, las variables `one` y `two` contienen los strings individuales `'a'` y `'b'`, respectivamente. Cuando usas el operador `+` entre ellos, actúa como un pegamento, uniendo los strings de extremo a extremo. En este caso, une `'a'` y `'b'`, dando como resultado el string concatenado `'ab'`, que se imprime en la consola. @@ -20,4 +19,4 @@ Aquí, las variables `one` y `two` contienen los strings individuales `'a'` y `' ## 💡 Pista: -+ Si necesitas más explicación sobre como la **concatenación** funciona en Python, puedes ver este clip: https://www.youtube.com/watch?v=T1nyPuAhd1U&ab_channel=ProgramaResuelto (`ctrl + click` en el enlance para abrir el video) ++ Si necesitas más explicación sobre como funciona la **concatenación** en Python, puedes ver este clip: https://www.youtube.com/watch?v=T1nyPuAhd1U&ab_channel=ProgramaResuelto (`ctrl + click` en el enlace para abrir el video) From 2c1348bb42f2ec6188c6d55c1aecb1bcf63cfb73 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 11:57:33 +0100 Subject: [PATCH 006/105] Update solution.hide.py --- exercises/06-String-Concatenation/solution.hide.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/06-String-Concatenation/solution.hide.py b/exercises/06-String-Concatenation/solution.hide.py index 45c6ee72..74f82acc 100644 --- a/exercises/06-String-Concatenation/solution.hide.py +++ b/exercises/06-String-Concatenation/solution.hide.py @@ -3,6 +3,6 @@ my_var1 = "Hello" my_var2 = "World" -## Don't change below this line -the_new_string = my_var1+' '+my_var2 -print(the_new_string) \ No newline at end of file +## Don't change anything below this line +the_new_string = my_var1 + ' ' + my_var2 +print(the_new_string) From 67dd5801398535c174174684789837181de1e0a6 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 11:57:47 +0100 Subject: [PATCH 007/105] Update app.py --- exercises/06-String-Concatenation/app.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/06-String-Concatenation/app.py b/exercises/06-String-Concatenation/app.py index 5eefe43b..97521fb2 100644 --- a/exercises/06-String-Concatenation/app.py +++ b/exercises/06-String-Concatenation/app.py @@ -1,6 +1,6 @@ # ✅ ↓ Set the values for my_var1 and my_var2 here ↓ ✅ -## Don't change below this line -the_new_string = my_var1+' '+my_var2 -print(the_new_string) \ No newline at end of file +## Don't change anything below this line +the_new_string = my_var1 + ' ' + my_var2 +print(the_new_string) From e2f3dc7f03e72b40821c787d8b41c446d4091fb6 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 12:01:51 +0100 Subject: [PATCH 008/105] Update test.py --- exercises/06-String-Concatenation/test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/06-String-Concatenation/test.py b/exercises/06-String-Concatenation/test.py index 69fe26a8..a0d74abb 100644 --- a/exercises/06-String-Concatenation/test.py +++ b/exercises/06-String-Concatenation/test.py @@ -27,7 +27,7 @@ def test_my_var2_value(): from app import my_var2 assert my_var2.lower() == "world" -@pytest.mark.it("Variable my_var2 value should be 'World'") +@pytest.mark.it("Don't remove the_new_string variable") def test_the_new_string_exists(): import app try: @@ -38,4 +38,4 @@ def test_the_new_string_exists(): @pytest.mark.it('Print "Hello World" on the console') def test_for_file_output(): captured = buffer.getvalue() - assert "hello world\n" in captured.lower() #add \n because the console jumps the line on every print \ No newline at end of file + assert "hello world\n" in captured.lower() #add \n because the console jumps the line on every print From 1159d314dd0cd005600a7b6e5549377cb30d31bf Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 12:10:02 +0100 Subject: [PATCH 009/105] Update README.md --- exercises/07-Create-a-Basic-HTML/README.md | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/exercises/07-Create-a-Basic-HTML/README.md b/exercises/07-Create-a-Basic-HTML/README.md index f6abf000..4cd0be34 100644 --- a/exercises/07-Create-a-Basic-HTML/README.md +++ b/exercises/07-Create-a-Basic-HTML/README.md @@ -8,20 +8,18 @@ Let's continue using string concatenation to generate HTML... ## 📝 Instructions: -1. Create a variable **html_document**. +1. Create the variable `html_document`. -2. The code on the left contains 8 variables with different string values, please use the variables concatenating them together to set the value of the variable **html_document** -a new string that has the content of a typical HTML document (with the HTML tags in the -right order). +2. The code on the left contains 8 variables with different string values, please use the variables concatenating them together to set the value of the variable `html_document` +to a new string that has the content of a typical HTML document (with the HTML tags in the right order). -3. Then, print the value of **html_document** on the console. +3. Then, print the value of `html_document` on the console. ## 💡 Hint: + Expected Result: -```sh - +```html ``` From c8fe037f8322cd3f9bc9cdcd47208ab2b658343e Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 12:13:08 +0100 Subject: [PATCH 010/105] Update README.es.md --- exercises/07-Create-a-Basic-HTML/README.es.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/exercises/07-Create-a-Basic-HTML/README.es.md b/exercises/07-Create-a-Basic-HTML/README.es.md index 682ad8c0..0abe48b4 100644 --- a/exercises/07-Create-a-Basic-HTML/README.es.md +++ b/exercises/07-Create-a-Basic-HTML/README.es.md @@ -4,19 +4,17 @@ Continuemos concatenando strings para generar un documento HTML básico... ## 📝 Instrucciones: -1. Crea una variable **html_document**. +1. Crea la variable `html_document`. -2. El código a la izquierda contiene 8 variables con diferentes valores de tipo *string*. Por favor, usa las variables concatenándolas entre ellas para establecer el valor de la variable **html_document** como nuevo string que tenga el contenido de un documento HTML típico (con las etiquetas HTML -en el orden correcto). +2. El código a la izquierda contiene 8 variables con diferentes valores de tipo *string*. Por favor, usa las variables concatenándolas entre ellas para establecer el valor de la variable `html_document` a la estructura típica de un documento HTML (con las etiquetas HTML en el orden correcto). -3. Luego, imprime el valor de **html_document** en la consola. +3. Luego, imprime el valor de `html_document` en la consola. ## 💡 Pista: + Resultado esperado: -```sh - +```html ``` From 2405e34d23467ad32a4fcdcd9984c50b16b4950b Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 12:15:10 +0100 Subject: [PATCH 011/105] Update solution.hide.py --- exercises/07-Create-a-Basic-HTML/solution.hide.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/07-Create-a-Basic-HTML/solution.hide.py b/exercises/07-Create-a-Basic-HTML/solution.hide.py index 4e180299..cda52eee 100644 --- a/exercises/07-Create-a-Basic-HTML/solution.hide.py +++ b/exercises/07-Create-a-Basic-HTML/solution.hide.py @@ -11,5 +11,5 @@ # ✅ ↓ start coding below here ↓ ✅ -html_document = e+c+g+a+f+h+d+b -print(html_document) \ No newline at end of file +html_document = e + c + g + a + f + h + d + b +print(html_document) From aa99cc6354bea4027cc2af7af1ee5fc1955cb64f Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 12:16:20 +0100 Subject: [PATCH 012/105] Update README.md --- exercises/07-Create-a-Basic-HTML/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/07-Create-a-Basic-HTML/README.md b/exercises/07-Create-a-Basic-HTML/README.md index 4cd0be34..2c5d41f4 100644 --- a/exercises/07-Create-a-Basic-HTML/README.md +++ b/exercises/07-Create-a-Basic-HTML/README.md @@ -2,7 +2,7 @@ tutorial: "https://www.youtube.com/watch?v=j14V-eS8mRg" --- -# `07` Create a basic HTML +# `07` Create a Basic HTML Let's continue using string concatenation to generate HTML... From cc1a4132c8711f65244340f44983c6c8d7a432d1 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 12:23:46 +0100 Subject: [PATCH 013/105] Update README.md --- exercises/08.1-Your-First-If/README.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/exercises/08.1-Your-First-If/README.md b/exercises/08.1-Your-First-If/README.md index e1f1a58e..36442de0 100644 --- a/exercises/08.1-Your-First-If/README.md +++ b/exercises/08.1-Your-First-If/README.md @@ -10,23 +10,23 @@ The current application is asking how much money the user has. Once the user inp 1. If the user has more than $100, we answer: "Give me your money!". -2. If the user has more than $50, we answer: "Buy me some coffee you cheap!". +2. If the user has more than $50, we answer: "Buy me some coffee, you cheap!". -3. If the user has less or equal than $50, we answer: "You are a poor guy, go away!". +3. If the user has less than or equal to $50, we answer: "You are a poor guy, go away!". -## 💡 Hint: +## 💡 Hints: -+ Use an If/else statement to check the value of the `total` variable. ++ Use an `if...else` statement to check the value of the `total` variable. + Further information [here](https://docs.python.org/3/tutorial/controlflow.html#if-statements). + Here's a quick reminder on relational operators: - | Operator | Description | Syntax | - |----------|--------------------------------------------------------------------|-----------| - | > | Greater than: True if the left operand is greater than the right | x > y | - | < | Less than: True if the left operand is less than the right | x < y | - | == | Equal to: True if both operands are equal | x == y | - | != | Not equal to – True if operands are not equal | x != y | - | >= | Greater than or equal to: True if left operand is greater or equal | x >= y | - | <= | Less than or equal to: True if left operand is less than or equal | x <= y | + | Operator | Description | Syntax | + |----------|------------------------------------------------------------------------|-----------| + | > | Greater than: True if the left operand is greater than the right | x > y | + | < | Less than: True if the left operand is less than the right | x < y | + | == | Equal to: True if both operands are equal | x == y | + | != | Not equal to: True if operands are not equal | x != y | + | >= | Greater than or equal to: True if the left operand is greater or equal | x >= y | + | <= | Less than or equal to: True if the left operand is less or equal | x <= y | From 91a56dae7a2f3b714feabd9ac4baeb458f04a61f Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 12:24:37 +0100 Subject: [PATCH 014/105] Update README.md --- exercises/08.1-Your-First-If/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/08.1-Your-First-If/README.md b/exercises/08.1-Your-First-If/README.md index 36442de0..8f36b753 100644 --- a/exercises/08.1-Your-First-If/README.md +++ b/exercises/08.1-Your-First-If/README.md @@ -2,7 +2,7 @@ tutorial: "https://www.youtube.com/watch?v=x9wqa5WQZiM" --- -# `08.1` Your First if... +# `08.1` Your First If... The current application is asking how much money the user has. Once the user inputs the amount, we need to **print** one of the following answers: From 85d3a8a8b3318af2f0f815b3fe8c5b6f375ac4ed Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 12:35:29 +0100 Subject: [PATCH 015/105] Update README.es.md --- exercises/08.1-Your-First-If/README.es.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/exercises/08.1-Your-First-If/README.es.md b/exercises/08.1-Your-First-If/README.es.md index 5fa04204..2443a544 100644 --- a/exercises/08.1-Your-First-If/README.es.md +++ b/exercises/08.1-Your-First-If/README.es.md @@ -4,15 +4,15 @@ La aplicación actual está preguntando cuánto dinero tiene el usuario. Una vez ## 📝 Instrucciones: -1. Si el usuario tiene más de $100, respondemos: "Give me your money!" (Dame tu dinero). +1. Si el usuario tiene más de $100, respondemos: "Give me your money!" (¡Dame tu dinero!). -2. Si el usuario tiene más de $50, respondemos: "Buy me some coffee you cheap!" (¡Comprame un café!). +2. Si el usuario tiene más de $50, respondemos: "Buy me some coffee, you cheap!" (¡Comprame un café!). 3. Si el usuario tiene igual o menos de $50, respondemos: "You are a poor guy, go away!" (¡Eres pobre!). -## 💡 Pista: +## 💡 Pistas: -+ Usa un condicional `if/else` para verificar el valor de la variable `total`. ++ Usa un condicional `if...else` para verificar el valor de la variable `total`. + Puedes leer más al respecto [aquí](https://docs.python.org/3/tutorial/controlflow.html#if-statements). @@ -20,9 +20,9 @@ La aplicación actual está preguntando cuánto dinero tiene el usuario. Una vez | Operador | Descripción | Sintaxis | |----------|------------------------------------------------------------------------------|----------| - | > | Mayor que: Verdadero si el operando izquierdo es mayor que el derecho | x > y | - | < | Menor que: Verdadero si el operando izquierdo es menor que el derecho | x < y | - | == | Igual a: Verdadero si ambos operandos son iguales | x == y | - | != | No igual a – Verdadero si los operandos no son iguales | x != y | - | >= | Mayor o igual que: Verdadero si el operando izquierdo es mayor o igual | x >= y | - | <= | Menor o igual que: Verdadero si el operando izquierdo es menor o igual | x <= y | + | > | Mayor que: True si el operando izquierdo es mayor que el derecho | x > y | + | < | Menor que: True si el operando izquierdo es menor que el derecho | x < y | + | == | Igual a: True si ambos operandos son iguales | x == y | + | != | No igual a: True si los operandos no son iguales | x != y | + | >= | Mayor o igual que: True si el operando izquierdo es mayor o igual | x >= y | + | <= | Menor o igual que: True si el operando izquierdo es menor o igual | x <= y | From 2b5a5423ffae4e2c23c31a2c4999545b1e897394 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 12:36:29 +0100 Subject: [PATCH 016/105] Update solution.hide.py --- exercises/08.1-Your-First-If/solution.hide.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/08.1-Your-First-If/solution.hide.py b/exercises/08.1-Your-First-If/solution.hide.py index 706c21fc..bb51f955 100644 --- a/exercises/08.1-Your-First-If/solution.hide.py +++ b/exercises/08.1-Your-First-If/solution.hide.py @@ -4,6 +4,6 @@ if total > 100: print("Give me your money!") elif total > 50: - print("Buy me some coffee you cheap!") + print("Buy me some coffee, you cheap!") else: - print("You are a poor guy, go away!") \ No newline at end of file + print("You are a poor guy, go away!") From 2a87fe5fc2f976e86de2469a2fd5bc9799e8a053 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 12:38:23 +0100 Subject: [PATCH 017/105] Update test.py --- exercises/08.1-Your-First-If/test.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/exercises/08.1-Your-First-If/test.py b/exercises/08.1-Your-First-If/test.py index 9d479ee5..8bda7fe2 100644 --- a/exercises/08.1-Your-First-If/test.py +++ b/exercises/08.1-Your-First-If/test.py @@ -31,37 +31,37 @@ def test_for_output_when_101(stdin, capsys, app): captured = capsys.readouterr() assert "Give me your money!\n" in captured.out -@pytest.mark.it("When input exactly 100 should print: Buy me some coffee you cheap ") +@pytest.mark.it("When input exactly 100 should print: Buy me some coffee, you cheap!") def test_for_output_when_100(capsys, app): with mock.patch('builtins.input', lambda x: 100): app() captured = capsys.readouterr() - assert "Buy me some coffee you cheap!\n" in captured.out + assert "Buy me some coffee, you cheap!\n" in captured.out -@pytest.mark.it("When input is 99 should print: Buy me some coffee you cheap ") +@pytest.mark.it("When input is 99 should print: Buy me some coffee, you cheap!") def test_for_output_when_99(capsys, app): with mock.patch('builtins.input', lambda x: 99): app() captured = capsys.readouterr() - assert "Buy me some coffee you cheap!\n" in captured.out + assert "Buy me some coffee, you cheap!\n" in captured.out -@pytest.mark.it("When input is 51 should print: Buy me some coffee you cheap ") +@pytest.mark.it("When input is 51 should print: Buy me some coffee, you cheap!") def test_for_output_when_51(capsys, app): with mock.patch('builtins.input', lambda x: 51): app() captured = capsys.readouterr() - assert "Buy me some coffee you cheap!\n" in captured.out + assert "Buy me some coffee, you cheap!\n" in captured.out -@pytest.mark.it("When input exactly 50 should print: You are a poor guy, go away") +@pytest.mark.it("When input exactly 50 should print: You are a poor guy, go away!") def test_for_output_when_50(capsys, app): with mock.patch('builtins.input', lambda x: 50): app() captured = capsys.readouterr() assert "You are a poor guy, go away!\n" in captured.out -@pytest.mark.it("When input less than 50 should print: You are a poor guy, go away") +@pytest.mark.it("When input less than 50 should print: You are a poor guy, go away!") def test_for_output_when_49(capsys, app): with mock.patch('builtins.input', lambda x: 49): app() captured = capsys.readouterr() - assert "You are a poor guy, go away!\n" in captured.out \ No newline at end of file + assert "You are a poor guy, go away!\n" in captured.out From d634922059a19bd010453c8bf7d9381872b31d62 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 12:40:05 +0100 Subject: [PATCH 018/105] Update README.es.md --- exercises/08.1-Your-First-If/README.es.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/08.1-Your-First-If/README.es.md b/exercises/08.1-Your-First-If/README.es.md index 2443a544..b7ea9ac6 100644 --- a/exercises/08.1-Your-First-If/README.es.md +++ b/exercises/08.1-Your-First-If/README.es.md @@ -6,7 +6,7 @@ La aplicación actual está preguntando cuánto dinero tiene el usuario. Una vez 1. Si el usuario tiene más de $100, respondemos: "Give me your money!" (¡Dame tu dinero!). -2. Si el usuario tiene más de $50, respondemos: "Buy me some coffee, you cheap!" (¡Comprame un café!). +2. Si el usuario tiene más de $50, respondemos: "Buy me some coffee, you cheap!" (¡Cómprame un café!). 3. Si el usuario tiene igual o menos de $50, respondemos: "You are a poor guy, go away!" (¡Eres pobre!). From 7617dba791a1a5be8d3bd1180363e83c69b7c482 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 12:45:30 +0100 Subject: [PATCH 019/105] Update README.md --- exercises/08.2-How-Much-The-Wedding-Costs/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/08.2-How-Much-The-Wedding-Costs/README.md b/exercises/08.2-How-Much-The-Wedding-Costs/README.md index 58ecdd99..3fd1585e 100644 --- a/exercises/08.2-How-Much-The-Wedding-Costs/README.md +++ b/exercises/08.2-How-Much-The-Wedding-Costs/README.md @@ -25,4 +25,4 @@ For example, if the user says that `20` people are attending to the wedding, it ## 💡 Hint: -+ Use if/else to divide your code and set the value of the `price` variable the right way. ++ Use `if...else` to divide your code and set the value of the `price` variable the right way. From d05cff084ab241d6756cb12fd4bf62903e71a382 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 12:48:07 +0100 Subject: [PATCH 020/105] Update README.es.md --- exercises/08.2-How-Much-The-Wedding-Costs/README.es.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/exercises/08.2-How-Much-The-Wedding-Costs/README.es.md b/exercises/08.2-How-Much-The-Wedding-Costs/README.es.md index 472fc950..37b763c1 100644 --- a/exercises/08.2-How-Much-The-Wedding-Costs/README.es.md +++ b/exercises/08.2-How-Much-The-Wedding-Costs/README.es.md @@ -1,4 +1,4 @@ -# `08.2` Cuánto costará la boda (if...else) +# `08.2` How Much The Wedding Costs (if...else) Aquí tenemos una tabla de precios de una compañía de catering de bodas: @@ -9,7 +9,7 @@ Aquí tenemos una tabla de precios de una compañía de catering de bodas: | Hasta 200 personas | $15,000 | | Más de 200 personas | $20,000 | ->Nota: Las cantidades en la tabla incluyen el número especificado. Por ejemplo, "Hasta 50 personas" incluye exactamente 50 personas. +> Nota: Las cantidades en la tabla incluyen el número especificado. Por ejemplo, "Hasta 50 personas" incluye exactamente 50 personas. ## 📝 Instrucciones: @@ -17,8 +17,8 @@ Aquí tenemos una tabla de precios de una compañía de catering de bodas: 2. Amplía el código proporcionado a la izquierda para cubrir todos los rangos posibles de invitados. 3. Asegúrate de que tu código calcule e imprima correctamente el precio en la consola según el input del usuario. -Por ejemplo, si la persona dice que `20` personas van a la boda, deberìa costar `$4,000` dólares. +Por ejemplo, si la persona dice que `20` personas van a la boda, debería costar `$4,000` dólares. ## 💡 Pista: -+ Usa if/else para dividir el código y definir el valor de la variable `price` de forma correcta. ++ Usa `if...else` para dividir el código y definir el valor de la variable `price` de forma correcta. From dbf1d962490f6f367a861790068a88c05ef01e77 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 12:50:37 +0100 Subject: [PATCH 021/105] Update test.py --- exercises/08.2-How-Much-The-Wedding-Costs/test.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/exercises/08.2-How-Much-The-Wedding-Costs/test.py b/exercises/08.2-How-Much-The-Wedding-Costs/test.py index 5a93afaf..2625b813 100644 --- a/exercises/08.2-How-Much-The-Wedding-Costs/test.py +++ b/exercises/08.2-How-Much-The-Wedding-Costs/test.py @@ -16,7 +16,7 @@ def test_for_print(capsys): regex2 = re.compile(r"elif\s*") assert bool(regex2.search(content)) == True -@pytest.mark.it("Between 101 and 199 guests sould be priced 15,000") +@pytest.mark.it("Between 101 and 199 guests, it should cost 15,000") def test__between_100_and_200(capsys, app): with mock.patch('builtins.input', lambda x: 199): app() @@ -24,7 +24,7 @@ def test__between_100_and_200(capsys, app): price = 15000 assert "Your wedding will cost "+str(price)+" dollars\n" in captured.out -@pytest.mark.it("Between 100 and 51 guests sould be priced 10,000") +@pytest.mark.it("Between 100 and 51 guests, it should cost 10,000") def test_between_101_and_51(capsys, app): with mock.patch('builtins.input', lambda x: 100): app() @@ -33,7 +33,7 @@ def test_between_101_and_51(capsys, app): assert "Your wedding will cost "+str(price)+" dollars\n" in captured.out -@pytest.mark.it("Less than 50 guests sould be priced 4,000") +@pytest.mark.it("Less than 50 guests, it should cost 4,000") def test_less_than_50(capsys, app): with mock.patch('builtins.input', lambda x: 49): app() @@ -41,10 +41,10 @@ def test_less_than_50(capsys, app): price = 4000 "Your wedding will cost "+str(price)+" dollars\n" in captured.out -@pytest.mark.it("More than 200 should be priced 20,000") +@pytest.mark.it("More than 200 guests, it should cost 20,000") def test_t(capsys, app): with mock.patch('builtins.input', lambda x: 201): app() captured = capsys.readouterr() price = 20000 - "Your wedding will cost "+str(price)+" dollars\n" in captured.out \ No newline at end of file + "Your wedding will cost "+str(price)+" dollars\n" in captured.out From 86653017d99515d1db28fd66ccca137a12bea37c Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 13:03:39 +0100 Subject: [PATCH 022/105] Update README.md --- exercises/09-Random-Numbers/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/09-Random-Numbers/README.md b/exercises/09-Random-Numbers/README.md index 021fe0d8..8c625187 100644 --- a/exercises/09-Random-Numbers/README.md +++ b/exercises/09-Random-Numbers/README.md @@ -4,9 +4,9 @@ tutorial: "https://www.youtube.com/watch?v=uYqMOZ-jFag" # `09` Random Numbers -You can use the `randint()` function to get a random integer number. `randint()` is an inbuilt function of the **random** module in Python3. +You can use the `randint()` function to get a random integer number. `randint()` is an inbuilt function of the `random` module in Python3. - The random module offers various useful functions, including `randint()`, which generates random **whole** numbers within a given range passed as parameters. You can use it like this: `randint(numMin, numMax)`, where both the minimum and maximum numbers are included in the range. +The random module offers various useful functions, including `randint()`, which generates random **whole** numbers within a given range passed as parameters. You can use it like this: `randint(numMin, numMax)`, where both the minimum and maximum numbers are included in the range. ## 📝 Instructions: @@ -14,4 +14,4 @@ You can use the `randint()` function to get a random integer number. `randint()` ## 💡 Hint: -+ For additional documentation on random module visit: https://www.tutorialsteacher.com/python/random-module \ No newline at end of file ++ For additional documentation on the `random` module, visit: https://www.tutorialsteacher.com/python/random-module From b2fd154c8bc38796a42fad2e71dfb53fbf4d5500 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 13:04:13 +0100 Subject: [PATCH 023/105] Update README.md --- exercises/09-Random-Numbers/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/09-Random-Numbers/README.md b/exercises/09-Random-Numbers/README.md index 8c625187..fcfff339 100644 --- a/exercises/09-Random-Numbers/README.md +++ b/exercises/09-Random-Numbers/README.md @@ -6,7 +6,7 @@ tutorial: "https://www.youtube.com/watch?v=uYqMOZ-jFag" You can use the `randint()` function to get a random integer number. `randint()` is an inbuilt function of the `random` module in Python3. -The random module offers various useful functions, including `randint()`, which generates random **whole** numbers within a given range passed as parameters. You can use it like this: `randint(numMin, numMax)`, where both the minimum and maximum numbers are included in the range. +The random module offers various useful functions, including `randint()`, which generates random **whole** numbers within a given range passed as parameters. You can use it like this: `randint(min_num, max_num)`, where both the minimum and maximum numbers are included in the range. ## 📝 Instructions: From 30e21f04f4ad6e13473a2adaf4bf61a3351fd7a5 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 13:11:26 +0100 Subject: [PATCH 024/105] Update README.es.md --- exercises/09-Random-Numbers/README.es.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/exercises/09-Random-Numbers/README.es.md b/exercises/09-Random-Numbers/README.es.md index da28bb47..b77ad09e 100644 --- a/exercises/09-Random-Numbers/README.es.md +++ b/exercises/09-Random-Numbers/README.es.md @@ -1,13 +1,13 @@ # `09` Random Numbers -Puedes usar la función `randint()`para obtener un número entero aleatorio. `randint()` es una funcion interna del módulo **random** en Python 3. +Puedes usar la función `randint()` para obtener un número entero aleatorio. `randint()` es una función interna del módulo `random` en Python3. -El módulo random da acceso a varias funciones útiles y una de ellas, la función `randint()`, genera números **enteros* aleatorios entre un rango que le pasemos por parámetro, por ejemplo: `randint(numMinimo, numMaximo)`. El numero minimo y el numero maximo en dicho rango son inclusivos. +El módulo random da acceso a varias funciones útiles y una de ellas, la función `randint()`, genera números **enteros** aleatorios entre un rango que le pasemos por parámetro, por ejemplo: `randint(num_minimo, num_maximo)`. El número mínimo y el número máximo en dicho rango son inclusivos. ## 📝 Instrucciones: -1. Actualmente el código está devolviendo números decimales aleatorios, por favor actualiza la función en el código para hacer que devuelva un número entero (no decimal) entre 1 y 10. +1. Actualmente, el código está devolviendo números decimales aleatorios, por favor actualiza la función en el código para hacer que devuelva un número entero (no decimal) entre 1 y 10. -## 💡 Pistas: +## 💡 Pista: -+ Puedes encontrar información addicional sobre el modulo random aquí: https://ellibrodepython.com/numeros-aleatorios-python \ No newline at end of file ++ Puedes encontrar información adicional sobre el módulo `random` aquí: https://ellibrodepython.com/numeros-aleatorios-python From 8164724d8ed6fd283a65273b87201ade60c1f847 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 13:24:47 +0100 Subject: [PATCH 025/105] Update README.md --- exercises/10-Calling-Your-First-Function/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/exercises/10-Calling-Your-First-Function/README.md b/exercises/10-Calling-Your-First-Function/README.md index 7a19da1c..06593196 100644 --- a/exercises/10-Calling-Your-First-Function/README.md +++ b/exercises/10-Calling-Your-First-Function/README.md @@ -13,11 +13,11 @@ Functions are amazing because of many things, but mainly because you can encapsu 2. The function `is_odd` is defined at the beginning of the code, please call that function inside `my_main_code` passing it the number `45345` and print the result on the console. -## :mag_right: Important: +## 🔎 Important: -There's a series of exercises dedicated to Functions [here](https://github.com/4GeeksAcademy/python-functions-programming-exercises), we encourage you to go and finish those after your **first Function exercise** (And then... come back! :smiley). +There's a series of exercises dedicated to functions [here](https://github.com/4GeeksAcademy/python-functions-programming-exercises), we encourage you to go and finish those after your **first Function exercise** (And then... come back! 😄). -## 💡Hint: +## 💡 Hint: -+ Check this out for additional information on functions and function calls: https://www.w3schools.com/python/python_functions.asp \ No newline at end of file ++ Check this out for additional information on functions and function calls: https://www.w3schools.com/python/python_functions.asp From cabc386d8ee24a309a9f86ad12a8fbf6f44fbc79 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 13:26:07 +0100 Subject: [PATCH 026/105] Update README.md --- exercises/10-Calling-Your-First-Function/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/10-Calling-Your-First-Function/README.md b/exercises/10-Calling-Your-First-Function/README.md index 06593196..6fcf8277 100644 --- a/exercises/10-Calling-Your-First-Function/README.md +++ b/exercises/10-Calling-Your-First-Function/README.md @@ -15,7 +15,7 @@ Functions are amazing because of many things, but mainly because you can encapsu ## 🔎 Important: -There's a series of exercises dedicated to functions [here](https://github.com/4GeeksAcademy/python-functions-programming-exercises), we encourage you to go and finish those after your **first Function exercise** (And then... come back! 😄). +There's a series of exercises dedicated to functions [here](https://github.com/4GeeksAcademy/python-functions-programming-exercises), we encourage you to go and finish those after your **first Function exercise** (And then... come back! 😃). ## 💡 Hint: From 2da2289a10a066a1d5b4e35f5c950a1503ec936e Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 13:26:44 +0100 Subject: [PATCH 027/105] Update README.md --- exercises/10-Calling-Your-First-Function/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/10-Calling-Your-First-Function/README.md b/exercises/10-Calling-Your-First-Function/README.md index 6fcf8277..1db9a3c5 100644 --- a/exercises/10-Calling-Your-First-Function/README.md +++ b/exercises/10-Calling-Your-First-Function/README.md @@ -15,7 +15,7 @@ Functions are amazing because of many things, but mainly because you can encapsu ## 🔎 Important: -There's a series of exercises dedicated to functions [here](https://github.com/4GeeksAcademy/python-functions-programming-exercises), we encourage you to go and finish those after your **first Function exercise** (And then... come back! 😃). +There's a series of exercises dedicated to functions [here](https://github.com/4GeeksAcademy/python-functions-programming-exercises), we encourage you to go and finish those after your **first function exercise** (And then... come back! 😃). ## 💡 Hint: From 9a7251498668552f9a056b281e01c0d36e2aebb1 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 13:27:28 +0100 Subject: [PATCH 028/105] Update README.es.md --- exercises/10-Calling-Your-First-Function/README.es.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/exercises/10-Calling-Your-First-Function/README.es.md b/exercises/10-Calling-Your-First-Function/README.es.md index 70cc213f..29bc48a1 100644 --- a/exercises/10-Calling-Your-First-Function/README.es.md +++ b/exercises/10-Calling-Your-First-Function/README.es.md @@ -8,11 +8,11 @@ Las funciones son increíbles por muchas cosas, pero principalmente porque puede 2. La función `is_odd` está definida al inicio del código, por favor llama a esa función dentro de `my_main_code` pasándole el número `45345` e imprime el resultado en la consola. -## :mag_right: Importante: +## 🔎 Importante: - + Hay una serie de ejercicios dedicados a las funciones [aquí](https://github.com/4GeeksAcademy/python-functions-programming-exercises), te recomendamos realizarlos después de hacer **tu primera función** en este ejercicio. (luego..¡Regresa! :smiley:). ++ Hay una serie de ejercicios dedicados a las funciones [aquí](https://github.com/4GeeksAcademy/python-functions-programming-exercises), te recomendamos realizarlos después de hacer **tu primera función** en este ejercicio. (luego... ¡Regresa! 😃). - ## 💡Pista: +## 💡 Pista: - + Puedes consultar esta pagina para obtener información adicional sobre funciones y llamadas a funciones: https://www.freecodecamp.org/espanol/news/guia-de-funciones-de-python-con-ejemplos/ \ No newline at end of file ++ Puedes consultar esta página para obtener información adicional sobre funciones y llamadas a funciones: https://www.freecodecamp.org/espanol/news/guia-de-funciones-de-python-con-ejemplos/ From 5d2be4a7256a8a68ecbdd4b833eceda638d65b08 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 13:29:37 +0100 Subject: [PATCH 029/105] Update test.py --- exercises/10-Calling-Your-First-Function/test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/10-Calling-Your-First-Function/test.py b/exercises/10-Calling-Your-First-Function/test.py index 9deb6879..2544ae4b 100644 --- a/exercises/10-Calling-Your-First-Function/test.py +++ b/exercises/10-Calling-Your-First-Function/test.py @@ -29,7 +29,7 @@ def test_call_is_odd(): my_main_code() mocked_is_odd.assert_called_with(45345) -@pytest.mark.it('The console should output "True" inside the function my_main_code ') +@pytest.mark.it('The console should output "True" inside the function my_main_code') def test_for_file_output(capsys): from app import my_main_code my_main_code() From 204f6c314f28f02aaa9503926e6bf0ef6aadec2f Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 13:38:16 +0100 Subject: [PATCH 030/105] Update README.md --- .../10.1-Creating-Your-First-Function/README.md | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/exercises/10.1-Creating-Your-First-Function/README.md b/exercises/10.1-Creating-Your-First-Function/README.md index cb233ddb..73faf321 100644 --- a/exercises/10.1-Creating-Your-First-Function/README.md +++ b/exercises/10.1-Creating-Your-First-Function/README.md @@ -6,20 +6,16 @@ tutorial: "https://www.youtube.com/watch?v=K0aDrl41SnQ" ## 📝 Instructions: -1. The function `add_numbers` is supposed to return the sum of 2 given numbers, please -complete the needed code inside of the function to make it behave as expected. +1. The function `add_numbers` is supposed to return the sum of 2 given numbers, please complete the needed code inside the function to make it behave as expected. -2. Expected Result: the exercise should print the number 7 in the console. +2. The exercise should print the number 7 in the console. ## 💡 Hint: -+ There is a function `"add_numbers"` already declared, it is receiving 2 parameters -(variables `a` and `b`), as a developer you were given a task to fill the -function content with the code needed to sum variable `a` with variable `b` and -return the result of that operation. ++ There is a function `add_numbers` already declared, it receives 2 parameters (variables `a` and `b`). As a developer, you were given the task to fill the function's body with the code needed to sum variable `a` with variable `b` and return the result of that operation. ## 🔎 Important: -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). +For more practice with 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). -Try them, and then come back!😃 +Try them, and then come back! 😃 From efc1e480442765eff5255f17925e999b935e831c Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 13:43:32 +0100 Subject: [PATCH 031/105] Update README.es.md --- exercises/10.1-Creating-Your-First-Function/README.es.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/exercises/10.1-Creating-Your-First-Function/README.es.md b/exercises/10.1-Creating-Your-First-Function/README.es.md index 52fa6f6a..978f547f 100644 --- a/exercises/10.1-Creating-Your-First-Function/README.es.md +++ b/exercises/10.1-Creating-Your-First-Function/README.es.md @@ -4,16 +4,15 @@ 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. -2. Resultado esperado: el ejercicio debería escribir el número 7 en la cónsola. +2. Resultado esperado: el ejercicio debería escribir el número 7 en la consola. ## 💡 Pista: -+ Hay una función `add_numbers` ya declarada, que está recibiendo dos parámetros -(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. ++ Hay una función `add_numbers` ya declarada, que está recibiendo dos parámetros (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. ## 🔎 Importante: - + 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). ++ 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). -¡Inténtalos, y luego regresa!😃 +¡Inténtalos, y luego regresa! 😃 From 9aca335e0e27aa79c9c889ae6a6ee444d9d4ada0 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 13:44:11 +0100 Subject: [PATCH 032/105] Update app.py --- exercises/10.1-Creating-Your-First-Function/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/10.1-Creating-Your-First-Function/app.py b/exercises/10.1-Creating-Your-First-Function/app.py index bea9825c..e9c3e3ca 100644 --- a/exercises/10.1-Creating-Your-First-Function/app.py +++ b/exercises/10.1-Creating-Your-First-Function/app.py @@ -1,5 +1,5 @@ def addNumbers(a,b): - # This is the function body. ✅↓ Write your code here. ↓✅ + # This is the function's body ✅↓ Write your code here ↓✅ # ❌ ↓ DON'T CHANGE THE CODE BELOW ↓ ❌ From 32e714b33b3c3e8035d45f25443fc2d71fceb04a Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 13:44:31 +0100 Subject: [PATCH 033/105] Update app.py --- exercises/10.1-Creating-Your-First-Function/app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/10.1-Creating-Your-First-Function/app.py b/exercises/10.1-Creating-Your-First-Function/app.py index e9c3e3ca..4db5352c 100644 --- a/exercises/10.1-Creating-Your-First-Function/app.py +++ b/exercises/10.1-Creating-Your-First-Function/app.py @@ -1,6 +1,6 @@ -def addNumbers(a,b): +def add_numbers(a,b): # This is the function's body ✅↓ Write your code here ↓✅ # ❌ ↓ DON'T CHANGE THE CODE BELOW ↓ ❌ -print(addNumbers(3,4)) +print(add_numbers(3,4)) From 6182cc618c9286f51d6eb7ce6c287ce668aee00d Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 13:45:15 +0100 Subject: [PATCH 034/105] Update solution.hide.py --- .../10.1-Creating-Your-First-Function/solution.hide.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/exercises/10.1-Creating-Your-First-Function/solution.hide.py b/exercises/10.1-Creating-Your-First-Function/solution.hide.py index 619f2145..2d72fdd1 100644 --- a/exercises/10.1-Creating-Your-First-Function/solution.hide.py +++ b/exercises/10.1-Creating-Your-First-Function/solution.hide.py @@ -1,6 +1,6 @@ -def addNumbers(a,b): - # This is the function body. ✅↓ Write your code here. ↓✅ - return b + a +def add_numbers(a,b): + # This is the function's body ✅↓ Write your code here ↓✅ + return a + b # ❌ ↓ DON'T CHANGE THE CODE BELOW ↓ ❌ -print(addNumbers(3,4)) +print(add_numbers(3,4)) From 3161d7557c43018063c2668cf900c32e0c43b9d8 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 13:50:17 +0100 Subject: [PATCH 035/105] Update test.py --- .../10.1-Creating-Your-First-Function/test.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/exercises/10.1-Creating-Your-First-Function/test.py b/exercises/10.1-Creating-Your-First-Function/test.py index ae4b341d..040c9c60 100644 --- a/exercises/10.1-Creating-Your-First-Function/test.py +++ b/exercises/10.1-Creating-Your-First-Function/test.py @@ -7,19 +7,19 @@ import sys path = os.path.dirname(os.path.abspath(__file__))+'/app.py' -@pytest.mark.it('The function addNumbers should exist') +@pytest.mark.it('The function add_numbers should exist') def test_for_function(): try: - app.addNumbers + app.add_numbers except AttributeError: - raise AttributeError("The function addNumbers should exist") + raise AttributeError("The function add_numbers should exist") @pytest.mark.it('Print the function in console with the values: 3, 4') def test_for_function_print(): with open(path, 'r') as content_file: content = content_file.read() - regex = re.compile(r"print\s*\(\s*addNumbers\s*\(\s*3\s*,\s*4\s*\)\s*\)") + regex = re.compile(r"print\s*\(\s*add_numbers\s*\(\s*3\s*,\s*4\s*\)\s*\)") assert bool(regex.search(content)) == True @@ -32,12 +32,12 @@ def test_for_print(): @pytest.mark.it('Function should sum the two given numbers') def test_for_return(): - from app import addNumbers - result = addNumbers(3,4) + from app import add_numbers + result = add_numbers(3,4) assert result == 7 @pytest.mark.it('Function should sum the two given numbers. Testing with different numbers') def test_for_return_2(): - from app import addNumbers - result = addNumbers(10,5) - assert result == 15 \ No newline at end of file + from app import add_numbers + result = add_numbers(10,5) + assert result == 15 From 688a96213881f9bfef75e143f57fc1512a1aefd6 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 13:59:22 +0100 Subject: [PATCH 036/105] Update README.md --- exercises/11-Create-A-New-Function/README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/exercises/11-Create-A-New-Function/README.md b/exercises/11-Create-A-New-Function/README.md index e79fc1e0..e9444222 100644 --- a/exercises/11-Create-A-New-Function/README.md +++ b/exercises/11-Create-A-New-Function/README.md @@ -4,26 +4,26 @@ tutorial: "https://www.youtube.com/watch?v=XazswkTqKJI" # `11` Create a New Function -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: +As you know, functions are useful blocks 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: ```py def add_numbers(a, b): - print(a + b) + print(a + b) ``` But Python comes with a bunch of "pre-defined" functions that you can use, for example: ```py import random -# Generates a random number between -# a given positive range +# Generates a random number between a given positive range + r1 = random.randint(0, 10) print("Random number between 0 and 10 is % s" % (r1)) ``` You can use the `randint()` function to get a random whole 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()`. +The **random module** gives access to various useful functions, one of them being able to generate random numbers, which is `randint()`. ## 📝 Instructions: @@ -35,6 +35,6 @@ The **random module** gives access to various useful functions and one of them b + One possible solution involves using two predefined functions: the `randint()` or `randrange()` function. -+ Don't forget to import the **random module**. ++ Don't forget to import the `random` module. -+ You can check the documentation here: https://docs.python.org/3/library/random.html#functions-for-integers \ No newline at end of file ++ You can check the documentation here: https://docs.python.org/3/library/random.html#functions-for-integers From 79f4de7d0ae53925de07650cd75846ad5ab6b7a2 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 14:02:56 +0100 Subject: [PATCH 037/105] Update README.md --- exercises/11-Create-A-New-Function/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/11-Create-A-New-Function/README.md b/exercises/11-Create-A-New-Function/README.md index e9444222..e09e2610 100644 --- a/exercises/11-Create-A-New-Function/README.md +++ b/exercises/11-Create-A-New-Function/README.md @@ -33,7 +33,7 @@ The **random module** gives access to various useful functions, one of them bein ## 💡 Hints: -+ One possible solution involves using two predefined functions: the `randint()` or `randrange()` function. ++ One possible solution involves using one out of two predefined functions: the `randint()` or `randrange()` functions. + Don't forget to import the `random` module. From bf3ae00e1bd069369a890423a9be25b7ef23b7de Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 14:05:37 +0100 Subject: [PATCH 038/105] Update README.es.md --- exercises/11-Create-A-New-Function/README.es.md | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/exercises/11-Create-A-New-Function/README.es.md b/exercises/11-Create-A-New-Function/README.es.md index c1ae2f22..e1e45372 100644 --- a/exercises/11-Create-A-New-Function/README.es.md +++ b/exercises/11-Create-A-New-Function/README.es.md @@ -2,20 +2,19 @@ Como sabes, las funciones son un bloque de código útil que puedes reusar tantas veces como necesites. -En el último ejercicio, tenías una función que recibía dos parámetros -(dos entradas) y devolvía la suma de ellos. Así: +En el último ejercicio, tenías una función que recibía dos parámetros (dos entradas) y devolvía la suma de ellos. Así: ```py def add_numbers(a, b): - print(a + b) + print(a + b) ``` Pero Python viene con un conjunto de funciones "pre-definidas" que puedes usar, por ejemplo: ```py import random -# Genera un número aleatorio dentro -# de un rango posiivo dado +# Genera un número aleatorio dentro de un rango posiivo dado + r1 = random.randint(0, 10) print("Random number between 0 and 10 is % s" % (r1)) ``` @@ -26,14 +25,14 @@ El **módulo random** te da acceso a varias funciones útiles y una de ellas es, ## 📝 Instrucciones: -1. Por favor, ahora crea una función llamada `generate_random` que devuelva un número aleatorio entre 0 y 9 cada vez que le llame. +1. Por favor, crea una función llamada `generate_random` que devuelva un número aleatorio entre 0 y 9 cada vez que se llame. 2. Imprime el resultado que la función retorna al ser llamada. ## 💡 Pistas: -+ Una posible solución involucra el uso de dos funciones predefinidas: las funciones `randint` o `randrange`. ++ Una posible solución involucra el uso de una de dos funciones predefinidas: la función `randint` o `randrange`. -+ No olvides importar el **módulo random**. ++ No olvides importar el módulo `random`. -+ Puedes consultar la documentación en: https://docs.python.org/3/library/random.html#functions-for-integers \ No newline at end of file ++ Puedes consultar la documentación en: https://docs.python.org/3/library/random.html#functions-for-integers From 285c2cd53d0069792be6a234ece0d330ef22cd69 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 14:06:42 +0100 Subject: [PATCH 039/105] Update app.py --- exercises/11-Create-A-New-Function/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/11-Create-A-New-Function/app.py b/exercises/11-Create-A-New-Function/app.py index ed1c5597..46b20099 100644 --- a/exercises/11-Create-A-New-Function/app.py +++ b/exercises/11-Create-A-New-Function/app.py @@ -1,3 +1,3 @@ import random -# ✅↓ Write your code here. ↓✅ +# ✅↓ Write your code here ↓✅ From b5bfb7122f1bcec72cc1eb6c9ac99fe57beb7ae6 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 14:06:55 +0100 Subject: [PATCH 040/105] Update solution.hide.py --- exercises/11-Create-A-New-Function/solution.hide.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/11-Create-A-New-Function/solution.hide.py b/exercises/11-Create-A-New-Function/solution.hide.py index 943706e3..79538e38 100644 --- a/exercises/11-Create-A-New-Function/solution.hide.py +++ b/exercises/11-Create-A-New-Function/solution.hide.py @@ -1,6 +1,6 @@ import random -# ✅↓ Write your code here. ↓✅ +# ✅↓ Write your code here ↓✅ def generate_random(): result = random.randint(0,9) - return result \ No newline at end of file + return result From 7ab26ae9a0343d2b1dc47c8d657cfd8f92808da7 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 14:08:00 +0100 Subject: [PATCH 041/105] Update test.py --- exercises/11-Create-A-New-Function/test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/11-Create-A-New-Function/test.py b/exercises/11-Create-A-New-Function/test.py index cb308b05..850f0ab9 100644 --- a/exercises/11-Create-A-New-Function/test.py +++ b/exercises/11-Create-A-New-Function/test.py @@ -14,7 +14,7 @@ def test_function_exists(): except ImportError: raise ImportError("The function 'generate_random' should exist on app.py") -@pytest.mark.it("The function 'generate_random' should return random number between 0 and 9") +@pytest.mark.it("The function 'generate_random' should return a random number between 0 and 9") def test_for_return(): from app import generate_random result = generate_random() @@ -31,7 +31,7 @@ def test_for_type_random(): regex2 = re.compile(r"random.randrange\s*\(") assert bool(regex.search(content)) == True or bool(regex2.search(content)) == True -@pytest.mark.it('You should be using print()') +@pytest.mark.it('You should print() the result of the function') def test_for_type_random(): with open(path, 'r') as content_file: content = content_file.read() From 40a46fe65456e462443574b8e2f6d556817c72dc Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 14:10:20 +0100 Subject: [PATCH 042/105] Update solution.hide.py --- exercises/11-Create-A-New-Function/solution.hide.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/exercises/11-Create-A-New-Function/solution.hide.py b/exercises/11-Create-A-New-Function/solution.hide.py index 79538e38..ef03d021 100644 --- a/exercises/11-Create-A-New-Function/solution.hide.py +++ b/exercises/11-Create-A-New-Function/solution.hide.py @@ -4,3 +4,5 @@ def generate_random(): result = random.randint(0,9) return result + +print(generate_random()) From 0b2f48462846f4c21d79b902784018ba7e63cefd Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 14:17:56 +0100 Subject: [PATCH 043/105] Update test.py --- exercises/11-Create-A-New-Function/test.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/exercises/11-Create-A-New-Function/test.py b/exercises/11-Create-A-New-Function/test.py index 850f0ab9..867b7a93 100644 --- a/exercises/11-Create-A-New-Function/test.py +++ b/exercises/11-Create-A-New-Function/test.py @@ -31,9 +31,10 @@ def test_for_type_random(): regex2 = re.compile(r"random.randrange\s*\(") assert bool(regex.search(content)) == True or bool(regex2.search(content)) == True -@pytest.mark.it('You should print() the result of the function') -def test_for_type_random(): +@pytest.mark.it('You should print() the output of the function') +def test_for_function_print(): + with open(path, 'r') as content_file: content = content_file.read() - - assert "print" in content + regex = re.compile(r"print\s*\(\s*generate_random\s*\(\s*\)\s*\)") + assert bool(regex.search(content)) == True From dbca2efefbd60ab869980f7208fe565ac38a02a6 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 14:21:46 +0100 Subject: [PATCH 044/105] Update README.md --- exercises/12-Rand-From-One-to-Twelve/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/12-Rand-From-One-to-Twelve/README.md b/exercises/12-Rand-From-One-to-Twelve/README.md index cd12a399..ec81b66c 100644 --- a/exercises/12-Rand-From-One-to-Twelve/README.md +++ b/exercises/12-Rand-From-One-to-Twelve/README.md @@ -8,10 +8,10 @@ tutorial: "https://www.youtube.com/watch?v=EdyMlVlNUT0" 1. Change whatever you need to change to make the algorithm print random integers between 1 and 12. -2. This time use `randrange()`function. +2. This time use the `randrange()` function. ## 💡 Hints: + It should print between 1 and 12, not between 0 and 12. -+ This exercise is super simple, don't complicate yourself!😃 \ No newline at end of file ++ This exercise is super simple, don't complicate yourself! 😃 From 1719e2553a020395bfb89249090778464256ea8f Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 14:22:15 +0100 Subject: [PATCH 045/105] Update README.es.md --- exercises/12-Rand-From-One-to-Twelve/README.es.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/12-Rand-From-One-to-Twelve/README.es.md b/exercises/12-Rand-From-One-to-Twelve/README.es.md index bcfae4d9..b1f9d2b8 100644 --- a/exercises/12-Rand-From-One-to-Twelve/README.es.md +++ b/exercises/12-Rand-From-One-to-Twelve/README.es.md @@ -10,4 +10,4 @@ + Debería imprimir números entre 1 y 12, no entre 0 y 12. -+ Este ejercicio es super simple, no te compliques!😃 \ No newline at end of file ++ Este ejercicio es super simple, no te compliques! 😃 From 9c5cae8e8b445b838d604f1cc0d3a20b94f8909a Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 14:22:45 +0100 Subject: [PATCH 046/105] Update app.py --- exercises/12-Rand-From-One-to-Twelve/app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/12-Rand-From-One-to-Twelve/app.py b/exercises/12-Rand-From-One-to-Twelve/app.py index 7b5483ce..d7304410 100644 --- a/exercises/12-Rand-From-One-to-Twelve/app.py +++ b/exercises/12-Rand-From-One-to-Twelve/app.py @@ -1,8 +1,8 @@ import random def get_randomInt(): - # ✅↓ Write your code here. ↓✅ + # ✅↓ Write your code here ↓✅ return None # ❌ ↓ DON'T CHANGE THE CODE BELOW ↓ ❌ -print(get_randomInt()) \ No newline at end of file +print(get_randomInt()) From 4bbb22b4b5b705ff127662a8011b4fe2480bb06d Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 14:23:01 +0100 Subject: [PATCH 047/105] Update solution.hide.py --- exercises/12-Rand-From-One-to-Twelve/solution.hide.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/12-Rand-From-One-to-Twelve/solution.hide.py b/exercises/12-Rand-From-One-to-Twelve/solution.hide.py index 00d751b7..f1329ca0 100644 --- a/exercises/12-Rand-From-One-to-Twelve/solution.hide.py +++ b/exercises/12-Rand-From-One-to-Twelve/solution.hide.py @@ -1,9 +1,9 @@ import random def get_randomInt(): - # ✅↓ Write your code here. ↓✅ + # ✅↓ Write your code here ↓✅ random_number = random.randrange(1,13) return random_number # ❌ ↓ DON'T CHANGE THE CODE BELOW ↓ ❌ -print(get_randomInt()) \ No newline at end of file +print(get_randomInt()) From a9778d746f0e7164bd51893e31f958d3aaffb5e8 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 14:23:39 +0100 Subject: [PATCH 048/105] Update test.py --- exercises/12-Rand-From-One-to-Twelve/test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/12-Rand-From-One-to-Twelve/test.py b/exercises/12-Rand-From-One-to-Twelve/test.py index fe26718e..ed078ffe 100644 --- a/exercises/12-Rand-From-One-to-Twelve/test.py +++ b/exercises/12-Rand-From-One-to-Twelve/test.py @@ -16,7 +16,7 @@ def test_function_existence(app): except AttributeError: raise AttributeError("The function get_randomInt should exist") -@pytest.mark.it("Check that you are setting the correct values for the randrange function.") +@pytest.mark.it("Check that you are setting the correct values for the randrange function") def test_conditional(): with open(path, 'r') as content_file: content = content_file.read() @@ -29,7 +29,7 @@ def test_print_output(capsys, app): result = app.get_randomInt() assert result >= 1 or result <= 12 -@pytest.mark.it('You must call the function inside the print() function.') +@pytest.mark.it('You must call the function inside the print() function') def test_function_called_for(): with open(path, 'r') as content_file: content = content_file.read() From b88cf303665f0513902a59b4d6e0e7d876a3db92 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 14:23:53 +0100 Subject: [PATCH 049/105] Update test.py --- exercises/11-Create-A-New-Function/test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/11-Create-A-New-Function/test.py b/exercises/11-Create-A-New-Function/test.py index 867b7a93..2872531b 100644 --- a/exercises/11-Create-A-New-Function/test.py +++ b/exercises/11-Create-A-New-Function/test.py @@ -32,7 +32,7 @@ def test_for_type_random(): assert bool(regex.search(content)) == True or bool(regex2.search(content)) == True @pytest.mark.it('You should print() the output of the function') -def test_for_function_print(): +def test_function_called_for(): with open(path, 'r') as content_file: content = content_file.read() From 018eba7bcac4c1b48ba2818bbf2a55a43de90229 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 14:24:47 +0100 Subject: [PATCH 050/105] Update README.es.md --- exercises/12-Rand-From-One-to-Twelve/README.es.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/12-Rand-From-One-to-Twelve/README.es.md b/exercises/12-Rand-From-One-to-Twelve/README.es.md index b1f9d2b8..995d8094 100644 --- a/exercises/12-Rand-From-One-to-Twelve/README.es.md +++ b/exercises/12-Rand-From-One-to-Twelve/README.es.md @@ -10,4 +10,4 @@ + Debería imprimir números entre 1 y 12, no entre 0 y 12. -+ Este ejercicio es super simple, no te compliques! 😃 ++ Este ejercicio es super simple, ¡no te compliques! 😃 From 4a60088d7865d7af41610c8d3145e0ceb2774a58 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 15:18:08 +0100 Subject: [PATCH 051/105] Update README.md --- exercises/13-Create-A-For-Loop/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/13-Create-A-For-Loop/README.md b/exercises/13-Create-A-For-Loop/README.md index 22af4705..6a1acb10 100644 --- a/exercises/13-Create-A-For-Loop/README.md +++ b/exercises/13-Create-A-For-Loop/README.md @@ -4,7 +4,7 @@ tutorial: "https://www.youtube.com/watch?v=-HQtwsBnbMQ" # `13` Create A For Loop -Loops are very useful... You don't have to rewrite the same lines many times. +Loops are very useful. You don't have to rewrite the same lines many times. The `for` loop lets you run the same code for different values. @@ -12,7 +12,7 @@ The `for` loop lets you run the same code for different values. 1. Complete the function called `standards_maker`. -2. The function has to print 300 times the phrase "I will write questions if I am stuck". +2. The function has to print 300 times the phrase "I will ask questions if I am stuck". 3. Call the function `standards_maker()`. @@ -22,4 +22,4 @@ The `for` loop lets you run the same code for different values. ## 🔎 Important: -+ Read more on loops: https://www.w3schools.com/python/python_for_loops.asp \ No newline at end of file ++ Read more on loops: https://www.w3schools.com/python/python_for_loops.asp From cbec79108206d2434123d698042e17505b1a26b9 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 15:23:15 +0100 Subject: [PATCH 052/105] Update README.es.md --- exercises/13-Create-A-For-Loop/README.es.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/13-Create-A-For-Loop/README.es.md b/exercises/13-Create-A-For-Loop/README.es.md index 791965dc..b4e8b89f 100644 --- a/exercises/13-Create-A-For-Loop/README.es.md +++ b/exercises/13-Create-A-For-Loop/README.es.md @@ -1,6 +1,6 @@ # `13` Create A For Loop -Los bucles o loops son muy útiles... No tienes que reescribir las mismas líneas muchas veces. +Los bucles o loops son muy útiles. No tienes que reescribir las mismas líneas muchas veces. El bucle o loop `for` te permite ejecutar el mismo código varias veces para diferentes valores. @@ -8,7 +8,7 @@ El bucle o loop `for` te permite ejecutar el mismo código varias veces para dif 1. Completa la función llamada `standards_maker()`. -2. La función tiene que imprimir 300 veces la frase "Escribiré preguntas si estoy atascado". +2. La función tiene que imprimir 300 veces la frase "Haré preguntas si estoy atascado". 3. Llama a la función `standards_maker()`. @@ -18,4 +18,4 @@ El bucle o loop `for` te permite ejecutar el mismo código varias veces para dif ## 🔎 Importante: -+ Puedes leer más al respecto aquí: https://ellibrodepython.com/for-python \ No newline at end of file ++ Puedes leer más al respecto aquí: https://ellibrodepython.com/for-python From 3f2d1d0c5a8feb158f47822b10b525b0279cbfa1 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 15:23:32 +0100 Subject: [PATCH 053/105] Update solution.hide.py --- exercises/13-Create-A-For-Loop/solution.hide.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/13-Create-A-For-Loop/solution.hide.py b/exercises/13-Create-A-For-Loop/solution.hide.py index a616c235..2dd3965a 100644 --- a/exercises/13-Create-A-For-Loop/solution.hide.py +++ b/exercises/13-Create-A-For-Loop/solution.hide.py @@ -1,7 +1,7 @@ def standards_maker(): - # ✅↓ Write your code here. ↓✅ + # ✅↓ Write your code here ↓✅ for i in range(0, 300): - print("I will write questions if I am stuck") + print("I will ask questions if I am stuck") # ✅↓ remember to call the function outside (here) ↓✅ -standards_maker() \ No newline at end of file +standards_maker() From e8b97f942d6d464bbe27a89bf609ded3d32145b8 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 15:23:41 +0100 Subject: [PATCH 054/105] Update app.py --- exercises/13-Create-A-For-Loop/app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/13-Create-A-For-Loop/app.py b/exercises/13-Create-A-For-Loop/app.py index cc52a510..19631c70 100644 --- a/exercises/13-Create-A-For-Loop/app.py +++ b/exercises/13-Create-A-For-Loop/app.py @@ -1,5 +1,5 @@ def standards_maker(): - # ✅↓ Write your code here. ↓✅ + # ✅↓ Write your code here ↓✅ -# ✅↓ remember to call the function outside (here) ↓✅ \ No newline at end of file +# ✅↓ remember to call the function outside (here) ↓✅ From edd014514962dbd8bdad208c75fc9e1ff56897f9 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 15:25:07 +0100 Subject: [PATCH 055/105] Update test.py --- exercises/13-Create-A-For-Loop/test.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/exercises/13-Create-A-For-Loop/test.py b/exercises/13-Create-A-For-Loop/test.py index bac75fb6..7c108916 100644 --- a/exercises/13-Create-A-For-Loop/test.py +++ b/exercises/13-Create-A-For-Loop/test.py @@ -9,7 +9,7 @@ import re path = os.path.dirname(os.path.abspath(__file__))+'/app.py' -@pytest.mark.it("You should declare a function named standards_maker") +@pytest.mark.it("You should define a function named standards_maker") def test_variable_exists(): try: from app import standards_maker @@ -23,11 +23,11 @@ def test_for_loop(): regex = re.compile(r"for") assert bool(regex.search(content)) == True -@pytest.mark.it("You should include in the function standards_maker a for loop which prints the string in the instructions 300 times") +@pytest.mark.it("In the function standards_maker include a for loop which prints the string in the instructions 300 times") def test_for_file_output(capsys): captured = buffer.getvalue() - expected = ["I will write questions if I am stuck\n" for x in range(300)] - expected_2 = ["Escribiré preguntas si estoy atascado\n" for x in range(300)] + expected = ["I will ask questions if I am stuck\n" for x in range(300)] + expected_2 = ["Haré preguntas si estoy atascado\n" for x in range(300)] hasCorrectAnswer = ((captured == "".join(expected)) or (captured == "".join(expected_2))) @@ -40,7 +40,7 @@ def test_for_print(): regex = re.compile(r"print\s*\(.+\)") assert bool(regex.search(content)) == True -@pytest.mark.it("You should call the function standards_maker ") +@pytest.mark.it("You should call the function standards_maker") def test_callTheFunction(): with open(path, 'r') as content_file: content = content_file.read() From e6a5c2f3b2d2d20e982b987b39d8928bb39ffbca Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 15:40:23 +0100 Subject: [PATCH 056/105] Update README.md --- exercises/14-Your-First-Loop/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/exercises/14-Your-First-Loop/README.md b/exercises/14-Your-First-Loop/README.md index 990b2bd4..8d3da78c 100644 --- a/exercises/14-Your-First-Loop/README.md +++ b/exercises/14-Your-First-Loop/README.md @@ -4,17 +4,17 @@ tutorial: "https://www.youtube.com/watch?v=30sizcnVdGg" # `14` Your First Loop -## 📝 Instructions: +## 📝 Instructions: -1. Run this code, you'll see a count from 0 to 9 (White characters). +1. Run this code, and you'll see a count from 0 to 9. 2. Fix it so that it counts up to 11. -## 🔎 Important: +## 🔎 Important: + There's a series of exercises dedicated to Lists and Loops, we encourage you to go and finish those before continuing: [https://github.com/4GeeksAcademy/python-lists-loops-programming-exercises](https://github.com/4GeeksAcademy/python-lists-loops-programming-exercises). Then, come back!😊 -## 💡Hint: -+ You can find additional information on loops here: https://www.w3schools.com/python/python_for_loops.asp \ No newline at end of file +## 💡 Hint: ++ You can find additional information on loops here: https://www.w3schools.com/python/python_for_loops.asp From d10de54da518218e14f2acc755962d56cfdab5c5 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 15:41:43 +0100 Subject: [PATCH 057/105] Update README.es.md --- exercises/14-Your-First-Loop/README.es.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/exercises/14-Your-First-Loop/README.es.md b/exercises/14-Your-First-Loop/README.es.md index cfd69ae6..7e28efe6 100644 --- a/exercises/14-Your-First-Loop/README.es.md +++ b/exercises/14-Your-First-Loop/README.es.md @@ -1,16 +1,16 @@ # `14` Your First Loop -## 📝 Instrucciones: +## 📝 Instrucciones: -1. Ejecuta este código, verás una cuenta de 0 a 9 (caracteres blancos). +1. Ejecuta este código, verás una cuenta de 0 a 9. 2. Corrígelo para que cuente hasta 11. ## 🔎 Importante: -+ Hay una serie de ejercicios dedicados a listas y bucles o loops, te invitamos a realizarlos antes de continuar: [https://github.com/4GeeksAcademy/python-lists-loops-programming-exercises](https://github.com/4GeeksAcademy/python-lists-loops-programming-exercises). ++ Hay una serie de ejercicios dedicados a listas y bucles, te invitamos a realizarlos antes de continuar: [https://github.com/4GeeksAcademy/python-lists-loops-programming-exercises](https://github.com/4GeeksAcademy/python-lists-loops-programming-exercises). -!Luego, regresa!😊 +¡Luego, regresa! 😊 ## 💡 Pista: -+ Puedes encontrar información adicional aquí: https://tutorial.recursospython.com/bucles/ \ No newline at end of file ++ Puedes encontrar información adicional aquí: https://tutorial.recursospython.com/bucles/ From 116f2dd07df31fb665caa9d828ee5c3270202337 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 15:41:53 +0100 Subject: [PATCH 058/105] Update README.md --- exercises/14-Your-First-Loop/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/14-Your-First-Loop/README.md b/exercises/14-Your-First-Loop/README.md index 8d3da78c..af03d283 100644 --- a/exercises/14-Your-First-Loop/README.md +++ b/exercises/14-Your-First-Loop/README.md @@ -14,7 +14,7 @@ tutorial: "https://www.youtube.com/watch?v=30sizcnVdGg" + There's a series of exercises dedicated to Lists and Loops, we encourage you to go and finish those before continuing: [https://github.com/4GeeksAcademy/python-lists-loops-programming-exercises](https://github.com/4GeeksAcademy/python-lists-loops-programming-exercises). -Then, come back!😊 +Then, come back! 😊 ## 💡 Hint: + You can find additional information on loops here: https://www.w3schools.com/python/python_for_loops.asp From e933add494a846b4f3b599cdb1143aed8f033733 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 15:43:23 +0100 Subject: [PATCH 059/105] Update test.py --- exercises/14-Your-First-Loop/test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/14-Your-First-Loop/test.py b/exercises/14-Your-First-Loop/test.py index 51b6b831..c936b923 100644 --- a/exercises/14-Your-First-Loop/test.py +++ b/exercises/14-Your-First-Loop/test.py @@ -22,9 +22,9 @@ def test_for_function_output(capsys): captured = capsys.readouterr() assert "0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n" in captured.out -@pytest.mark.it('Use for loop') +@pytest.mark.it('Use a for loop') def test_for_loop(): with open(path, 'r') as content_file: content = content_file.read() regex = re.compile(r"for\s*") - assert bool(regex.search(content)) == True \ No newline at end of file + assert bool(regex.search(content)) == True From c1de8826c121d19df12920c797ed211e9e9bf240 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 16:06:15 +0100 Subject: [PATCH 060/105] Update README.md --- exercises/15-Looping-With-FizzBuzz/README.md | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/exercises/15-Looping-With-FizzBuzz/README.md b/exercises/15-Looping-With-FizzBuzz/README.md index 97b52c0f..a1e308dc 100644 --- a/exercises/15-Looping-With-FizzBuzz/README.md +++ b/exercises/15-Looping-With-FizzBuzz/README.md @@ -4,13 +4,19 @@ tutorial: "https://www.youtube.com/watch?v=fw3ukgmlSwQ" # `15` Looping With FizzBuzz -This is a typical beginner test that is required to complete interviews in Google, Facebook and all the other big tech companies. +This is a typical beginner test that is required to complete interviews at Google, Facebook and all the other big tech companies. ## 📝 Instructions: 1. Write the code needed to print in the console all the numbers from 1 to 100. + +2. For multiples of 3, instead of the number, print "Fizz". + +3. For multiples of 5, print "Buzz". + +4. For numbers that are multiples of both 3 and 5, print "FizzBuzz". -## Expected result: +## 💻 Expected result: ```py 1 @@ -41,12 +47,10 @@ Buzz There's a series of exercises dedicated to Lists and Loops, we encourage you to go and finish them before continuing: [https://github.com/4GeeksAcademy/python-lists-loops-programming-exercises](https://github.com/4GeeksAcademy/python-lists-loops-programming-exercises) -Then, come back!😊 +Then, come back! 😊 -## 💡 Hints: +## 💡 Hint: -+ For multiples of 3, instead of the number, print "Fizz". - -+ For multiples of 5, print "Buzz". ++ You have to use multiple `if` statements. -+ For numbers which are multiples of both 3 and 5, print "FizzBuzz". \ No newline at end of file ++ Think about the correct order of the different `if` statements to make the code do what you want. From 2cba5ed8b96d14fff7d3c2d97367a3f1cd800e93 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 16:22:58 +0100 Subject: [PATCH 061/105] Update README.es.md --- .../15-Looping-With-FizzBuzz/README.es.md | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/exercises/15-Looping-With-FizzBuzz/README.es.md b/exercises/15-Looping-With-FizzBuzz/README.es.md index 5e0706c6..fbaa200d 100644 --- a/exercises/15-Looping-With-FizzBuzz/README.es.md +++ b/exercises/15-Looping-With-FizzBuzz/README.es.md @@ -6,7 +6,13 @@ Esta es una típica prueba de principiante que es exigida para las entrevistas e 1. Escribe el código necesario para imprimir en la consola todos los números del 1 al 100. -## Resultado esperado: +2. Para múltiplos de 3, en lugar de imprimir el número, imprime "Fizz". + +3. Para múltiplos de 5, imprime "Buzz". + +4. Para números que son múltiplos de 3 y de 5, imprime "FizzBuzz". + +## 💻 Resultado esperado: ```py 1 @@ -34,16 +40,14 @@ Buzz ## 🔎 Importante: -+ Hay una serie de ejercicios dedicados a listas y ciclos, te invitamos a realizarlos antes de continuar: [https://github.com/4GeeksAcademy/python-lists-loops-programming-exercises](https://github.com/4GeeksAcademy/python-lists-loops-programming-exercises). +Hay una serie de ejercicios dedicados a listas y bucles, te invitamos a realizarlos antes de continuar: [https://github.com/4GeeksAcademy/python-lists-loops-programming-exercises](https://github.com/4GeeksAcademy/python-lists-loops-programming-exercises). -¡Luego, regresa!😊 +¡Luego, regresa! 😊 ## 💡 Pistas: -+ Para múltiplos de 3, en lugar de imprimir el número, imprime "Fizz". - -+ Para múltiplos de 5, imprime "Buzz". ++ Debes usar instrucciones `if`. -+ Para números que son múltiplos de 3 y de 5, imprime "FizzBuzz". ++ Piensa en el orden correcto de esos `if` para hacer que tu código haga lo que quieres. From 6c77594eae1b681b73d598cb7d5ac3677a5998ee Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 16:24:08 +0100 Subject: [PATCH 062/105] Update app.py --- exercises/15-Looping-With-FizzBuzz/app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/15-Looping-With-FizzBuzz/app.py b/exercises/15-Looping-With-FizzBuzz/app.py index 31d72741..fff86955 100644 --- a/exercises/15-Looping-With-FizzBuzz/app.py +++ b/exercises/15-Looping-With-FizzBuzz/app.py @@ -1,5 +1,5 @@ def fizz_buzz(): - # ✅↓ Write your code here. ↓✅ + # ✅↓ Write your code here ↓✅ # ❌↓ DON'T CHANGE THE CODE BELOW ↓❌ -fizz_buzz() \ No newline at end of file +fizz_buzz() From 6b2f2e6db0cc84ff19e692c804aad6bda1fea3a1 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 16:24:30 +0100 Subject: [PATCH 063/105] Update solution.hide.py --- exercises/15-Looping-With-FizzBuzz/solution.hide.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/15-Looping-With-FizzBuzz/solution.hide.py b/exercises/15-Looping-With-FizzBuzz/solution.hide.py index 2ae1311c..b01fb63d 100644 --- a/exercises/15-Looping-With-FizzBuzz/solution.hide.py +++ b/exercises/15-Looping-With-FizzBuzz/solution.hide.py @@ -1,5 +1,5 @@ def fizz_buzz(): - # ✅↓ Write your code here. ↓✅ + # ✅↓ Write your code here ↓✅ for i in range(1, 101): if i % 3 == 0 and i % 5 == 0: print("FizzBuzz") @@ -11,4 +11,4 @@ def fizz_buzz(): print(i) # ❌↓ DON'T CHANGE THE CODE BELOW ↓❌ -fizz_buzz() \ No newline at end of file +fizz_buzz() From 60c281bb5b983187908d5d1574635f8da6026915 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 16:25:06 +0100 Subject: [PATCH 064/105] Update test.py --- exercises/15-Looping-With-FizzBuzz/test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/15-Looping-With-FizzBuzz/test.py b/exercises/15-Looping-With-FizzBuzz/test.py index 5d8187c2..b8ecd541 100644 --- a/exercises/15-Looping-With-FizzBuzz/test.py +++ b/exercises/15-Looping-With-FizzBuzz/test.py @@ -16,14 +16,14 @@ def test_function_existence(): except AttributeError: raise AttributeError('The function fizz_buzz should exist') -@pytest.mark.it('Use for loop') +@pytest.mark.it('Use a for loop') def test_for_loop(): with open(path, 'r') as content_file: content = content_file.read() regex = re.compile(r"for\s*") assert bool(regex.search(content)) == True -@pytest.mark.it('2. Your function needs to print the correct output') +@pytest.mark.it('Your function needs to print the correct output') def test_for_function_output(capsys): fizz_buzz() captured = capsys.readouterr() From ff8952729553d3de6bac8f515f5c0ebfad0d3679 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 16:51:12 +0100 Subject: [PATCH 065/105] Update README.md --- exercises/16-Random-Colors-Loop/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/16-Random-Colors-Loop/README.md b/exercises/16-Random-Colors-Loop/README.md index 2c906d3b..d4c7b145 100644 --- a/exercises/16-Random-Colors-Loop/README.md +++ b/exercises/16-Random-Colors-Loop/README.md @@ -6,13 +6,13 @@ tutorial: "https://www.youtube.com/watch?v=8zH3JT3AuAw" We have created a function that returns a color based on a number between 0 and 3 (for any different number, it will return the color `black`). -Let's say that we are teachers in a 10 student classroom and we want to randomly assign ONE color, between `red`, `yellow`, `blue` and `green`, to EACH student. +Let's say that we are teachers in a 10 student classroom, and we want to randomly assign ONE color, between `red`, `yellow`, `blue` and `green`, to EACH student. (only 1 color per student) ## 📝 Instructions: -1. Change the function `get_allStudentColors` so it returns a list of 10 colors, were each item in the list represents the color assigned to each student. +1. Change the function `get_allStudentColors` so it returns a list of 10 colors, where each item in the list represents the color assigned to each student. ## 💡 Hints: @@ -22,4 +22,4 @@ Let's say that we are teachers in a 10 student classroom and we want to randomly - Use the `get_color` function, in this exercise to find out what color corresponds to the number obtained. -- Call (execute) the function `get_allStudentColors` and print its result in the console. \ No newline at end of file +- Call (execute) the function `get_allStudentColors` and print its result in the console. From c8261e23f27ce82896f7f2a084b0a44adea91d1f Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 16:51:37 +0100 Subject: [PATCH 066/105] Update README.md --- exercises/16-Random-Colors-Loop/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/16-Random-Colors-Loop/README.md b/exercises/16-Random-Colors-Loop/README.md index d4c7b145..e72e5e9f 100644 --- a/exercises/16-Random-Colors-Loop/README.md +++ b/exercises/16-Random-Colors-Loop/README.md @@ -20,6 +20,6 @@ Let's say that we are teachers in a 10 student classroom, and we want to randoml - In each iteration, generate a random number between 0 and 3 using the `randint()` function that we have seen in previous exercises. -- Use the `get_color` function, in this exercise to find out what color corresponds to the number obtained. +- Use the `get_color` function in this exercise, to find out what color corresponds to the number obtained. - Call (execute) the function `get_allStudentColors` and print its result in the console. From 0ecb29171cb4193fc7cbcc2f116f10c12e7828b7 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 16:56:36 +0100 Subject: [PATCH 067/105] Update README.es.md --- exercises/16-Random-Colors-Loop/README.es.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/exercises/16-Random-Colors-Loop/README.es.md b/exercises/16-Random-Colors-Loop/README.es.md index bbb78609..493f0c12 100644 --- a/exercises/16-Random-Colors-Loop/README.es.md +++ b/exercises/16-Random-Colors-Loop/README.es.md @@ -1,8 +1,8 @@ # `16` Random Colors (Loop) -Hemos creado una función que devuelve un color basado en un número entre 0 y 3 (cualquier número diferente, debe retornar el color `black` (negro)). +Hemos creado una función que devuelve un color basado en un número entre 0 y 3 (cualquier otro número retornará el color `black`). -Digamos que somos profesores en un aula con 10 estudiantes y queremos asignar a **cada estudiante** un color aleatorio entre `red` (rojo), `yellow` (amarillo), `blue` (azul) y `green` (verde). +Supongamos que somos profesores en un aula con 10 estudiantes y queremos asignar a **cada estudiante** un color aleatorio entre `red`, `yellow`, `blue` y `green`. (solo 1 color por estudiante) @@ -16,6 +16,6 @@ Digamos que somos profesores en un aula con 10 estudiantes y queremos asignar a + En cada iteración, genera un número aleatorio entre 0 y 3 usando la función `randint()` que hemos visto en ejercicios anteriores. -+ Usa la función `get_color`, en este ejercicio para saber qué color le corresponde al número obtenido. ++ Usa la función `get_color` en este ejercicio, para saber qué color le corresponde al número obtenido. -+ Llama (ejecuta) la funcion `get_allStudentColors` e imprime su resultado en la consola. \ No newline at end of file ++ Llama (ejecuta) la función `get_allStudentColors` e imprime su resultado en la consola. From 55cb7512c264c3a4523902c90db9ebe9b7e6d058 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 16:59:28 +0100 Subject: [PATCH 068/105] Update app.py --- exercises/16-Random-Colors-Loop/app.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/exercises/16-Random-Colors-Loop/app.py b/exercises/16-Random-Colors-Loop/app.py index 5753c14a..0e29ead7 100644 --- a/exercises/16-Random-Colors-Loop/app.py +++ b/exercises/16-Random-Colors-Loop/app.py @@ -1,16 +1,17 @@ import random def get_color(color_number=4): - # making sure is a number and not a string + # Making sure is a number and not a string color_number = int(color_number) - switcher={ + switcher = { 0:'red', 1:'yellow', 2:'blue', 3:'green', 4:'black' } + return switcher.get(color_number,"Invalid Color Number") # ❌ ⬆ DON'T CHANGE THE CODE ABOVE ⬆ ❌ @@ -19,6 +20,6 @@ def get_allStudentColors(): example_color = get_color(1) students_array = [] # ✅ ↓ your loop here ↓ ✅ + - -print(get_allStudentColors()) \ No newline at end of file +print(get_allStudentColors()) From 0734f3838ed8cb84609ffa9a066b136b174862c4 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 17:01:26 +0100 Subject: [PATCH 069/105] Update solution.hide.py --- exercises/16-Random-Colors-Loop/solution.hide.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/exercises/16-Random-Colors-Loop/solution.hide.py b/exercises/16-Random-Colors-Loop/solution.hide.py index 17b87502..caa17fb9 100644 --- a/exercises/16-Random-Colors-Loop/solution.hide.py +++ b/exercises/16-Random-Colors-Loop/solution.hide.py @@ -1,16 +1,17 @@ import random def get_color(color_number=4): - # making sure is a number and not a string + # Making sure is a number and not a string color_number = int(color_number) - switcher={ + switcher = { 0:'red', 1:'yellow', 2:'blue', 3:'green', 4:'black' } + return switcher.get(color_number,"Invalid Color Number") # ❌ ⬆ DON'T CHANGE THE CODE ABOVE ⬆ ❌ @@ -25,4 +26,4 @@ def get_allStudentColors(): return students_array -print(get_allStudentColors()) \ No newline at end of file +print(get_allStudentColors()) From e739b5f098e44b7bcb999ae51831c866fb8cfc8b Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 17:03:23 +0100 Subject: [PATCH 070/105] Update test.py --- exercises/16-Random-Colors-Loop/test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/16-Random-Colors-Loop/test.py b/exercises/16-Random-Colors-Loop/test.py index a25b67aa..e5585d70 100644 --- a/exercises/16-Random-Colors-Loop/test.py +++ b/exercises/16-Random-Colors-Loop/test.py @@ -31,11 +31,11 @@ def test_black_in_array(capsys, app): result = app.get_allStudentColors() assert result.count("black") == 0 -@pytest.mark.it('You should use for to iterate 10 times') +@pytest.mark.it('You should use a for loop to iterate 10 times') def use_for_loop(capsys): path = os.path.dirname(os.path.abspath(__file__))+'/app.py' with open(path, 'r') as content_file: content = content_file.read() pattern = r"for\s*" regex = re.compile(pattern) - assert bool(regex.search(content)) == True \ No newline at end of file + assert bool(regex.search(content)) == True From ab35dd0ecf7ed8028b97d8f736928c2061893ddd Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 17:06:54 +0100 Subject: [PATCH 071/105] Update README.md --- exercises/17-Russian-Roulette/README.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/exercises/17-Russian-Roulette/README.md b/exercises/17-Russian-Roulette/README.md index 43228267..f3a4aaab 100644 --- a/exercises/17-Russian-Roulette/README.md +++ b/exercises/17-Russian-Roulette/README.md @@ -2,10 +2,9 @@ Have you ever played Russian Roulette? It's super fun! If you make it (muahahahaha). -The revolver gun has only 6 slots for bullets... insert one bullet in one of the slots, -spin the revolver chamber to make the game random, nobody knows the bullet position. +The revolver gun has only 6 slots for bullets... insert one bullet in one of the slots, spin the revolver chamber to make the game random, nobody knows the bullet position. -FIRE!!!....... are you dead? +FIRE!!!...... are you dead? ## 📝 Instructions: @@ -13,10 +12,10 @@ FIRE!!!....... are you dead? 2. Compare the bullet position against the chamber position. -3. If the bullet position is equal to the chamber position then the function should return `You are dead!`, else it should return `Keep playing!` +3. If the bullet position is equal to the chamber position, then the function should return `You are dead!`, else it should return `Keep playing!` -## 💡 Hint: +## 💡 Hints: + You can get the chamber position by calling the `spin_chamber` function -+ If the bullet is at the same slot as the revolver chamber, then it will be fired (`You are dead!`). \ No newline at end of file ++ If the bullet is at the same slot as the revolver chamber, then it will be fired (`You are dead!`). From 7ee1b5ee398010059c387daa080acc462a078b35 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 17:14:10 +0100 Subject: [PATCH 072/105] Update README.es.md --- exercises/17-Russian-Roulette/README.es.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/exercises/17-Russian-Roulette/README.es.md b/exercises/17-Russian-Roulette/README.es.md index f6b4e500..25da2194 100644 --- a/exercises/17-Russian-Roulette/README.es.md +++ b/exercises/17-Russian-Roulette/README.es.md @@ -2,18 +2,20 @@ ¿Has jugado a la ruleta rusa? ¡Es muy divertido! Si no pierdes... (¡¡¡muuuajajajaja!!!). -Un revolver tiene seis orificios para balas... inserta una bala en uno de los orificios, -gira la cámara del revolver para hacer aleatorio el juego. Nadie sabrá dónde está la bala. +Un revolver tiene seis recámaras para balas... inserta una bala en una de las recámaras, gira el tambor del revolver para hacer aleatorio el juego. Nadie sabrá dónde está la bala. -¡¡¡FUEGO!!!....... ¿has muerto? +¡¡¡FUEGO!!!...... ¿Has muerto? ## 📝 Instrucciones: + 1. El juego casi funciona, por favor completa la función `fire_gun` para que el juego funcione. 2. Compara la posición de la bala con la posición de la recámara. 3. Si la posición de la bala es igual a la posición de la recámara, entonces la función debe retornar `You are dead!`, de lo contrario, debe retornar `Keep playing!` -## 💡 Pista: -- Puedes obtener la posición de la recámara llamando a la función `spin_chamber`. -- Si la bala está en el mismo compartimento que la recámara del revólver, entonces será disparada (`You are dead!`). \ No newline at end of file +## 💡 Pistas: + +- Puedes obtener la posición de la recámara llamando a la función `spin_chamber`. + +- Si la bala está en el mismo compartimento que la recámara del revólver, entonces será disparada (`You are dead!`). From 744db6c7f36c5bf2f7033409df6bd4dbea605ec6 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 17:18:53 +0100 Subject: [PATCH 073/105] Update solution.hide.py --- exercises/17-Russian-Roulette/solution.hide.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/17-Russian-Roulette/solution.hide.py b/exercises/17-Russian-Roulette/solution.hide.py index afdfddeb..bc8b74b8 100644 --- a/exercises/17-Russian-Roulette/solution.hide.py +++ b/exercises/17-Russian-Roulette/solution.hide.py @@ -8,10 +8,10 @@ def spin_chamber(): # ❌ ⬆ DON'T CHANGE THE CODE ABOVE ⬆ ❌ def fire_gun(): - # ✅ ↓ your loop here ↓ ✅ + # ✅ ↓ your code here ↓ ✅ if spin_chamber() == bullet_position: return "You're dead!" else: return "Keep playing!" -print(fire_gun()) \ No newline at end of file +print(fire_gun()) From 66e30d1dddc541efd6fc5bc326d41a7930f279de Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 17:19:00 +0100 Subject: [PATCH 074/105] Update app.py --- exercises/17-Russian-Roulette/app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/17-Russian-Roulette/app.py b/exercises/17-Russian-Roulette/app.py index d0503ccc..e8704639 100644 --- a/exercises/17-Russian-Roulette/app.py +++ b/exercises/17-Russian-Roulette/app.py @@ -8,8 +8,8 @@ def spin_chamber(): # ❌ ⬆ DON'T CHANGE THE CODE ABOVE ⬆ ❌ def fire_gun(): - # ✅ ↓ your loop here ↓ ✅ + # ✅ ↓ your code here ↓ ✅ return None -print(fire_gun()) \ No newline at end of file +print(fire_gun()) From 1e9dbcfd6e1b7c9bfe0c853919ed14b89bc79254 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 17:21:05 +0100 Subject: [PATCH 075/105] Update solution.hide.py --- exercises/17-Russian-Roulette/solution.hide.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/17-Russian-Roulette/solution.hide.py b/exercises/17-Russian-Roulette/solution.hide.py index bc8b74b8..15e0e350 100644 --- a/exercises/17-Russian-Roulette/solution.hide.py +++ b/exercises/17-Russian-Roulette/solution.hide.py @@ -8,9 +8,9 @@ def spin_chamber(): # ❌ ⬆ DON'T CHANGE THE CODE ABOVE ⬆ ❌ def fire_gun(): - # ✅ ↓ your code here ↓ ✅ + # ✅ ↓ your loop here ↓ ✅ if spin_chamber() == bullet_position: - return "You're dead!" + return "You are dead!" else: return "Keep playing!" From 0ee7f4da6012824ab44e4a89b013f4569ffe8257 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 17:38:55 +0100 Subject: [PATCH 076/105] Update README.md --- exercises/18-The-Beatles/README.md | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/exercises/18-The-Beatles/README.md b/exercises/18-The-Beatles/README.md index af3a8a78..3d5f6da6 100644 --- a/exercises/18-The-Beatles/README.md +++ b/exercises/18-The-Beatles/README.md @@ -8,22 +8,36 @@ Who does not like The Beatles? A BBC study has proved that 90% of kids don't know the band... so sad. :( -This is the chorus of one of the most famous Beatle songs: +This is the chorus of one of the most famous Beatles songs: -> Let it be, let it be, let it be, let it be, -> Whisper words of wisdom, +> Let it be, let it be, let it be, let it be +> +> Whisper words of wisdom +> > Let it be ## 📝 Instructions: -1. Create a function called `sing()` that returns a string with the exact same lyrics you can hear from the 3:10 sec to the end of the song at 3:54 sec https://www.youtube.com/watch?v=QDYfEBY9NM4. +1. Create a function called `sing()` that returns a string with the lyrics that you can hear from 3:21 sec to the end of the song at 3:50 sec https://www.youtube.com/watch?v=QDYfEBY9NM4. -## Expected output: +## 💻 Expected output: -`let it be, let it be, let it be, let it be, whisper words of wisdom, let it be, let it be, let it be, let it be, let it be, there will be an answer, let it be` +```text +let it be, +let it be, +let it be, +let it be, +there will be an answer, +let it be, +let it be, +let it be, +let it be, +let it be, +whisper words of wisdom, let it be +``` -## 💡 Hint: +## 💡 Hints: + The words "let it be" repeat all the time, you should probably create a loop for that. -+ If you need a refresher on loops and conditionals, check out this awesome resource: https://docs.python.org/3/tutorial/controlflow.html \ No newline at end of file ++ If you need a refresher on loops and conditionals, check out this awesome resource: https://docs.python.org/3/tutorial/controlflow.html From 0e4a2e6812e0e56845b60781152c88bf6f108dc6 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 17:39:52 +0100 Subject: [PATCH 077/105] Update README.md --- exercises/18-The-Beatles/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/18-The-Beatles/README.md b/exercises/18-The-Beatles/README.md index 3d5f6da6..f5f9fb47 100644 --- a/exercises/18-The-Beatles/README.md +++ b/exercises/18-The-Beatles/README.md @@ -10,9 +10,9 @@ A BBC study has proved that 90% of kids don't know the band... so sad. :( This is the chorus of one of the most famous Beatles songs: -> Let it be, let it be, let it be, let it be +> Let it be, let it be, let it be, let it be, > -> Whisper words of wisdom +> Whisper words of wisdom, > > Let it be From 3f6c929d733bb829c6b88518af2fa4a92a5d80c7 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 17:43:26 +0100 Subject: [PATCH 078/105] Update README.md --- exercises/18-The-Beatles/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/18-The-Beatles/README.md b/exercises/18-The-Beatles/README.md index f5f9fb47..d2ff6d1c 100644 --- a/exercises/18-The-Beatles/README.md +++ b/exercises/18-The-Beatles/README.md @@ -18,7 +18,7 @@ This is the chorus of one of the most famous Beatles songs: ## 📝 Instructions: -1. Create a function called `sing()` that returns a string with the lyrics that you can hear from 3:21 sec to the end of the song at 3:50 sec https://www.youtube.com/watch?v=QDYfEBY9NM4. +1. Create a function called `sing()` that returns a string with the lyrics that you can hear from 3:21 sec to the end of the song at 3:50 sec https://www.youtube.com/watch?v=QDYfEBY9NM4 ## 💻 Expected output: From 03e5a7a0e7ae10fe50c58eee4cc5b2d0df39eb2f Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 17:43:29 +0100 Subject: [PATCH 079/105] Update README.es.md --- exercises/18-The-Beatles/README.es.md | 28 ++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/exercises/18-The-Beatles/README.es.md b/exercises/18-The-Beatles/README.es.md index b58308bf..138bbba2 100644 --- a/exercises/18-The-Beatles/README.es.md +++ b/exercises/18-The-Beatles/README.es.md @@ -6,20 +6,34 @@ Un estudio de la BBC ha probado que el 90% de los niños y niñas no conocen la Este es el coro de una de las canciones más famosas de la banda: -> Let it be, let it be, let it be, let it be, -> Whisper words of wisdom, +> Let it be, let it be, let it be, let it be, +> +> Whisper words of wisdom, +> > Let it be ## 📝 Instrucciones: -1. Crea una función llamada `sing()` que retorne un string con la misma letra que puedes escuchar desde el segundo 3:10 hasta el final de la canción en el segundo 3:54 https://www.youtube.com/watch?v=QDYfEBY9NM4. +1. Crea una función llamada `sing()` que retorne un string con la misma letra que puedes escuchar desde el segundo 3:21 hasta el final de la canción en el segundo 3:50 https://www.youtube.com/watch?v=QDYfEBY9NM4 -## Resultado esperado: +## 💻 Resultado esperado: -`let it be, let it be, let it be, let it be, whisper words of wisdom, let it be, let it be, let it be, let it be, let it be, there will be an answer, let it be` +```text +let it be, +let it be, +let it be, +let it be, +there will be an answer, +let it be, +let it be, +let it be, +let it be, +let it be, +whisper words of wisdom, let it be +``` -## 💡 Pista: +## 💡 Pistas: -+ La frase "let it be" se repite todo el tiempo. Probablemente deberías usar un bucle o loop para eso 😊 ++ La frase "let it be" se repite todo el tiempo. Probablemente, deberías usar un bucle o loop para eso. 😊 + Si necesitas un repaso sobre los loops y/o condicionales, échale un vistazo a esto: https://docs.python.org/es/3/tutorial/controlflow.html From f732712044303bcccd68bfb590982a77e08ed050 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 17:43:50 +0100 Subject: [PATCH 080/105] Update app.py --- exercises/18-The-Beatles/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/18-The-Beatles/app.py b/exercises/18-The-Beatles/app.py index fd8b3103..d87e6fa1 100644 --- a/exercises/18-The-Beatles/app.py +++ b/exercises/18-The-Beatles/app.py @@ -1,2 +1,2 @@ -# ✅↓ Write your code here. ↓✅ +# ✅↓ Write your code here ↓✅ From 61c7ab309c60efb998c837c96cc04c1f626c8074 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 17:48:56 +0100 Subject: [PATCH 081/105] Update solution.hide.py --- exercises/18-The-Beatles/solution.hide.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/exercises/18-The-Beatles/solution.hide.py b/exercises/18-The-Beatles/solution.hide.py index 1088905d..f966b88f 100644 --- a/exercises/18-The-Beatles/solution.hide.py +++ b/exercises/18-The-Beatles/solution.hide.py @@ -1,13 +1,13 @@ -# ✅↓ Write your code here. ↓✅ +# ✅↓ Write your code here ↓✅ def sing(): song = "" for i in range(11): if i == 4: - song += "whisper words of wisdom, " + song += "there will be an answer, " elif i == 10: - song += "there will be an answer, let it be" + song += "whisper words of wisdom, let it be" else: song += "let it be, " return song -print(sing()) \ No newline at end of file +print(sing()) From 8f9150bd256057fe3ebefe11411a135e52fd4289 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 17:49:39 +0100 Subject: [PATCH 082/105] Update README.md --- exercises/18-The-Beatles/README.md | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/exercises/18-The-Beatles/README.md b/exercises/18-The-Beatles/README.md index d2ff6d1c..8c4ed4f9 100644 --- a/exercises/18-The-Beatles/README.md +++ b/exercises/18-The-Beatles/README.md @@ -22,19 +22,7 @@ This is the chorus of one of the most famous Beatles songs: ## 💻 Expected output: -```text -let it be, -let it be, -let it be, -let it be, -there will be an answer, -let it be, -let it be, -let it be, -let it be, -let it be, -whisper words of wisdom, let it be -``` +`let it be, let it be, let it be, let it be, there will be an answer, let it be, let it be, let it be, let it be, let it be, whisper words of wisdom, let it be` ## 💡 Hints: From 6e82e385ca3cce6c139590b8fb2dd44a6eaefac8 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 17:50:42 +0100 Subject: [PATCH 083/105] Update README.es.md --- exercises/18-The-Beatles/README.es.md | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/exercises/18-The-Beatles/README.es.md b/exercises/18-The-Beatles/README.es.md index 138bbba2..e0ba278c 100644 --- a/exercises/18-The-Beatles/README.es.md +++ b/exercises/18-The-Beatles/README.es.md @@ -18,19 +18,7 @@ Este es el coro de una de las canciones más famosas de la banda: ## 💻 Resultado esperado: -```text -let it be, -let it be, -let it be, -let it be, -there will be an answer, -let it be, -let it be, -let it be, -let it be, -let it be, -whisper words of wisdom, let it be -``` +`let it be, let it be, let it be, let it be, there will be an answer, let it be, let it be, let it be, let it be, let it be, whisper words of wisdom, let it be` ## 💡 Pistas: From 7b6861a2033e513355b945134ff64ee8b0d61ccd Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 17:52:06 +0100 Subject: [PATCH 084/105] Update test.py --- exercises/18-The-Beatles/test.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/exercises/18-The-Beatles/test.py b/exercises/18-The-Beatles/test.py index 0ebe1f60..58741885 100644 --- a/exercises/18-The-Beatles/test.py +++ b/exercises/18-The-Beatles/test.py @@ -8,7 +8,7 @@ import re import os -@pytest.mark.it("You should declare a function named sing and call it in the correct way") +@pytest.mark.it("You should declare a function named sing()") def test_function_sing_exists(app): try: assert app.sing @@ -23,9 +23,9 @@ def test_function_hardcode_output(): regex = re.compile(r"\breturn\s*[^\"][a-zA-Z0-9]*\b\s*") assert bool(regex.search(content)) == True -@pytest.mark.it("The function sing should return astring with the song lyrics") +@pytest.mark.it("The function sing() should return a string with the song lyrics") def test_function_sing_exists(app): try: - assert app.sing() == "let it be, let it be, let it be, let it be, whisper words of wisdom, let it be, let it be, let it be, let it be, let it be, there will be an answer, let it be" + assert app.sing() == "let it be, let it be, let it be, let it be, there will be an answer, let it be, let it be, let it be, let it be, let it be, whisper words of wisdom, let it be" except AttributeError: - raise AttributeError("The function 'sing' should exist on app.py") \ No newline at end of file + raise AttributeError("The function 'sing' should exist on app.py") From e1a6b38a46180bfe744a019fef3828be88f275d5 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 17:53:37 +0100 Subject: [PATCH 085/105] Update solution.hide.py --- exercises/18-The-Beatles/solution.hide.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/18-The-Beatles/solution.hide.py b/exercises/18-The-Beatles/solution.hide.py index f966b88f..c3a33816 100644 --- a/exercises/18-The-Beatles/solution.hide.py +++ b/exercises/18-The-Beatles/solution.hide.py @@ -3,11 +3,11 @@ def sing(): song = "" for i in range(11): if i == 4: - song += "there will be an answer, " + song += "there will be an answer,\n" elif i == 10: song += "whisper words of wisdom, let it be" else: - song += "let it be, " + song += "let it be,\n" return song print(sing()) From 503c4a5e10d2eadd279a2f15948170d8a7eb1123 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 17:54:41 +0100 Subject: [PATCH 086/105] Update test.py --- exercises/18-The-Beatles/test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/18-The-Beatles/test.py b/exercises/18-The-Beatles/test.py index 58741885..d452f892 100644 --- a/exercises/18-The-Beatles/test.py +++ b/exercises/18-The-Beatles/test.py @@ -26,6 +26,6 @@ def test_function_hardcode_output(): @pytest.mark.it("The function sing() should return a string with the song lyrics") def test_function_sing_exists(app): try: - assert app.sing() == "let it be, let it be, let it be, let it be, there will be an answer, let it be, let it be, let it be, let it be, let it be, whisper words of wisdom, let it be" + assert app.sing() == "let it be,\nlet it be,\nlet it be,\nlet it be,\nthere will be an answer,\nlet it be,\nlet it be,\nlet it be,\nlet it be,\nlet it be,\nwhisper words of wisdom, let it be" except AttributeError: raise AttributeError("The function 'sing' should exist on app.py") From 01b8ae504330f243f1188c55de1b066d5ab91101 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 17:56:00 +0100 Subject: [PATCH 087/105] Update README.md --- exercises/18-The-Beatles/README.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/exercises/18-The-Beatles/README.md b/exercises/18-The-Beatles/README.md index 8c4ed4f9..d2ff6d1c 100644 --- a/exercises/18-The-Beatles/README.md +++ b/exercises/18-The-Beatles/README.md @@ -22,7 +22,19 @@ This is the chorus of one of the most famous Beatles songs: ## 💻 Expected output: -`let it be, let it be, let it be, let it be, there will be an answer, let it be, let it be, let it be, let it be, let it be, whisper words of wisdom, let it be` +```text +let it be, +let it be, +let it be, +let it be, +there will be an answer, +let it be, +let it be, +let it be, +let it be, +let it be, +whisper words of wisdom, let it be +``` ## 💡 Hints: From 18b75bf4914e4a4e1a076c36b67ffe30d2f6c166 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 17:56:13 +0100 Subject: [PATCH 088/105] Update README.es.md --- exercises/18-The-Beatles/README.es.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/exercises/18-The-Beatles/README.es.md b/exercises/18-The-Beatles/README.es.md index e0ba278c..138bbba2 100644 --- a/exercises/18-The-Beatles/README.es.md +++ b/exercises/18-The-Beatles/README.es.md @@ -18,7 +18,19 @@ Este es el coro de una de las canciones más famosas de la banda: ## 💻 Resultado esperado: -`let it be, let it be, let it be, let it be, there will be an answer, let it be, let it be, let it be, let it be, let it be, whisper words of wisdom, let it be` +```text +let it be, +let it be, +let it be, +let it be, +there will be an answer, +let it be, +let it be, +let it be, +let it be, +let it be, +whisper words of wisdom, let it be +``` ## 💡 Pistas: From b39bbd6e22695e0b3dd2f26b39711ed8df2bdd1b Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 18:00:34 +0100 Subject: [PATCH 089/105] Update README.es.md --- exercises/18-The-Beatles/README.es.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/exercises/18-The-Beatles/README.es.md b/exercises/18-The-Beatles/README.es.md index 138bbba2..25df04d7 100644 --- a/exercises/18-The-Beatles/README.es.md +++ b/exercises/18-The-Beatles/README.es.md @@ -36,4 +36,6 @@ whisper words of wisdom, let it be + La frase "let it be" se repite todo el tiempo. Probablemente, deberías usar un bucle o loop para eso. 😊 ++ Para hacer un salto de línea en un string debes insertar los siguientes caracteres dentro del string `\n`. Por ejemplo, `"let it be,\n"`. + + Si necesitas un repaso sobre los loops y/o condicionales, échale un vistazo a esto: https://docs.python.org/es/3/tutorial/controlflow.html From 929a2e64ad222a8f2c5c1071762807e154cab71e Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 18:03:52 +0100 Subject: [PATCH 090/105] Update README.es.md --- exercises/18-The-Beatles/README.es.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/18-The-Beatles/README.es.md b/exercises/18-The-Beatles/README.es.md index 25df04d7..39821d20 100644 --- a/exercises/18-The-Beatles/README.es.md +++ b/exercises/18-The-Beatles/README.es.md @@ -36,6 +36,6 @@ whisper words of wisdom, let it be + La frase "let it be" se repite todo el tiempo. Probablemente, deberías usar un bucle o loop para eso. 😊 -+ Para hacer un salto de línea en un string debes insertar los siguientes caracteres dentro del string `\n`. Por ejemplo, `"let it be,\n"`. ++ Para hacer un salto de línea en un string debes insertar los siguientes caracteres dentro del string `\n`. Por ejemplo, `"let it be,\n"`. Ahora cuando imprimas tu string en la consola lo podrás visualizar mejor si lo necesitas. + Si necesitas un repaso sobre los loops y/o condicionales, échale un vistazo a esto: https://docs.python.org/es/3/tutorial/controlflow.html From 9f51e0990508895f49666e7edef6e6b91b0d9915 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 18:04:35 +0100 Subject: [PATCH 091/105] Update README.md --- exercises/18-The-Beatles/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/exercises/18-The-Beatles/README.md b/exercises/18-The-Beatles/README.md index d2ff6d1c..5b5179e0 100644 --- a/exercises/18-The-Beatles/README.md +++ b/exercises/18-The-Beatles/README.md @@ -40,4 +40,6 @@ whisper words of wisdom, let it be + The words "let it be" repeat all the time, you should probably create a loop for that. ++ To make a line jump in a string you must insert the following characters inside of your string `\n`. For example, `"let it be,\n"`. Now when you print your string in the console you will visualize it better if you need to. + + If you need a refresher on loops and conditionals, check out this awesome resource: https://docs.python.org/3/tutorial/controlflow.html From d681ed4d733d037e86a7236e8324e0d064e222be Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 18:06:00 +0100 Subject: [PATCH 092/105] Update README.md --- exercises/18-The-Beatles/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/18-The-Beatles/README.md b/exercises/18-The-Beatles/README.md index 5b5179e0..304cfb29 100644 --- a/exercises/18-The-Beatles/README.md +++ b/exercises/18-The-Beatles/README.md @@ -40,6 +40,6 @@ whisper words of wisdom, let it be + The words "let it be" repeat all the time, you should probably create a loop for that. -+ To make a line jump in a string you must insert the following characters inside of your string `\n`. For example, `"let it be,\n"`. Now when you print your string in the console you will visualize it better if you need to. ++ To make a line jump in a string, you must insert the following characters inside your string `\n`. For example, `"let it be,\n"`. Now when you print your string in the console, you will visualize it better if you need to. + If you need a refresher on loops and conditionals, check out this awesome resource: https://docs.python.org/3/tutorial/controlflow.html From 59d6ad51688d48b70f0b23e607111eff06b2b70a Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 18:18:15 +0100 Subject: [PATCH 093/105] Update README.md --- exercises/19-Bottles-Of-Milk/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/exercises/19-Bottles-Of-Milk/README.md b/exercises/19-Bottles-Of-Milk/README.md index ef5f2704..5594c5b5 100644 --- a/exercises/19-Bottles-Of-Milk/README.md +++ b/exercises/19-Bottles-Of-Milk/README.md @@ -14,7 +14,7 @@ Here you can listen to the song: https://www.youtube.com/watch?v=Xy-da43E6Lo 2. The function needs to **print** (use the `print` statement and not `return`) the exact same lyrics in the song. -## Expected result: +## 💻 Expected result: The result should be something like this: @@ -36,8 +36,8 @@ No more bottles of milk on the wall, no more bottles of milk. Go to the store and buy some more, 99 bottles of milk on the wall. ``` -## 💡Hints: +## 💡 Hints: -+ At the end of the song, the lyrics change because it is only **one** bottle (singular instead of plural). ++ At the end of the song, the lyrics change because there is only **one** bottle (singular instead of plural). -+ Read the last lyrics and you will see how the last line changes to `"go to the store and buy some more"`. \ No newline at end of file ++ Read the last lyrics, and you will see how the last line changes to `"go to the store and buy some more"`. From 3f03be920f29dd05038d50e94b325cff7ab17b39 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 18:19:27 +0100 Subject: [PATCH 094/105] Update README.es.md --- exercises/19-Bottles-Of-Milk/README.es.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/19-Bottles-Of-Milk/README.es.md b/exercises/19-Bottles-Of-Milk/README.es.md index e571c6a7..09deac43 100644 --- a/exercises/19-Bottles-Of-Milk/README.es.md +++ b/exercises/19-Bottles-Of-Milk/README.es.md @@ -8,7 +8,7 @@ Aquí puedes escucharla: https://www.youtube.com/watch?v=Xy-da43E6Lo 1. Por favor, declara una función llamada `number_of_bottles()`. -2. La función necesita **print** para imprimir la letra exacta de la canción (usa el método `print()` y no `return`). +2. La función necesita imprimir la letra exacta de la canción (usa el método `print()` y no `return`). ## Resultado esperado: @@ -36,4 +36,4 @@ Go to the store and buy some more, 99 bottles of milk on the wall. + Al final de la canción, la letra cambia porque es solo una botella (singular en lugar del plural). -+ Lee la última parte de la letra y verás como cambia la última línea a `"go to the store and by some more"`. \ No newline at end of file ++ Lee la última parte de la letra y verás como cambia la última línea a `"go to the store and by some more"`. From 1ea67ed364b935e529f91ff48455917d3ddd3cb4 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 18:20:27 +0100 Subject: [PATCH 095/105] Update README.md --- exercises/19-Bottles-Of-Milk/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/19-Bottles-Of-Milk/README.md b/exercises/19-Bottles-Of-Milk/README.md index 5594c5b5..410a5a6a 100644 --- a/exercises/19-Bottles-Of-Milk/README.md +++ b/exercises/19-Bottles-Of-Milk/README.md @@ -18,7 +18,7 @@ Here you can listen to the song: https://www.youtube.com/watch?v=Xy-da43E6Lo The result should be something like this: -```sh +```text 99 bottles of milk on the wall, 99 bottles of milk. Take one down and pass it around, 98 bottles of milk on the wall. @@ -40,4 +40,4 @@ Go to the store and buy some more, 99 bottles of milk on the wall. + At the end of the song, the lyrics change because there is only **one** bottle (singular instead of plural). -+ Read the last lyrics, and you will see how the last line changes to `"go to the store and buy some more"`. ++ Read the last lyrics, and you will see how the last line changes to `"Go to the store and by some more, 99 bottles of milk on the wall."`. From c3bc875f7942ce1dbc27b18d02e9d1d72d159839 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 18:20:29 +0100 Subject: [PATCH 096/105] Update README.es.md --- exercises/19-Bottles-Of-Milk/README.es.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/exercises/19-Bottles-Of-Milk/README.es.md b/exercises/19-Bottles-Of-Milk/README.es.md index 09deac43..992e248a 100644 --- a/exercises/19-Bottles-Of-Milk/README.es.md +++ b/exercises/19-Bottles-Of-Milk/README.es.md @@ -10,11 +10,11 @@ Aquí puedes escucharla: https://www.youtube.com/watch?v=Xy-da43E6Lo 2. La función necesita imprimir la letra exacta de la canción (usa el método `print()` y no `return`). -## Resultado esperado: +## 💻 Resultado esperado: El resultado debería ser algo como esto: -```sh +```text 99 bottles of milk on the wall, 99 bottles of milk. Take one down and pass it around, 98 bottles of milk on the wall. @@ -32,8 +32,8 @@ No more bottles of milk on the wall, no more bottles of milk. Go to the store and buy some more, 99 bottles of milk on the wall. ``` -## 💡Pistas: +## 💡 Pistas: + Al final de la canción, la letra cambia porque es solo una botella (singular en lugar del plural). -+ Lee la última parte de la letra y verás como cambia la última línea a `"go to the store and by some more"`. ++ Lee la última parte de la letra y verás como cambia la última línea a `"Go to the store and by some more, 99 bottles of milk on the wall."`. From 2a3253fbaf94f3df8d1cbe9565f347d13249b51e Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 18:20:52 +0100 Subject: [PATCH 097/105] Update app.py --- exercises/19-Bottles-Of-Milk/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/19-Bottles-Of-Milk/app.py b/exercises/19-Bottles-Of-Milk/app.py index 9ff11964..9733b0fc 100644 --- a/exercises/19-Bottles-Of-Milk/app.py +++ b/exercises/19-Bottles-Of-Milk/app.py @@ -1 +1 @@ -# ✅↓ Write your code here. ↓✅ +# ✅↓ Write your code here ↓✅ From 1169f9ef0a270b81d3dcbf67c1f3372a11de8f88 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 18:21:08 +0100 Subject: [PATCH 098/105] Update solution.hide.py --- exercises/19-Bottles-Of-Milk/solution.hide.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/19-Bottles-Of-Milk/solution.hide.py b/exercises/19-Bottles-Of-Milk/solution.hide.py index 52000ba9..658f18fc 100644 --- a/exercises/19-Bottles-Of-Milk/solution.hide.py +++ b/exercises/19-Bottles-Of-Milk/solution.hide.py @@ -1,4 +1,4 @@ -# ✅↓ Write your code here. ↓✅ +# ✅↓ Write your code here ↓✅ def number_of_bottles(): for x in range(99,2,-1): print(str(x) + " bottles of milk on the wall, " + str(x) + " bottles of milk. Take one down and pass it around, " + str(x-1)+ " bottles of milk on the wall.") @@ -7,4 +7,4 @@ def number_of_bottles(): print("No more bottles of milk on the wall, no more bottles of milk. Go to the store and buy some more, 99 bottles of milk on the wall.") return None -number_of_bottles() \ No newline at end of file +number_of_bottles() From 77944ba8f9441419715f66e81ffe1f57ea8be34f Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 18:23:03 +0100 Subject: [PATCH 099/105] Update test.py --- exercises/19-Bottles-Of-Milk/test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/19-Bottles-Of-Milk/test.py b/exercises/19-Bottles-Of-Milk/test.py index 86f8ff9d..70af0ca9 100644 --- a/exercises/19-Bottles-Of-Milk/test.py +++ b/exercises/19-Bottles-Of-Milk/test.py @@ -25,7 +25,7 @@ def test_function_spin_chamber(capsys, app): regex = r"number_of_bottles\(\)" assert re.match(regex, content[my_printCallVar]) -@pytest.mark.it('The function must return the expected output') +@pytest.mark.it('The function must print the expected output') def test_for_function_output(capsys): number_of_bottles() captured = capsys.readouterr() From 2e3754788af43b55ff4447925f38b6f0f4e21662 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 18:27:03 +0100 Subject: [PATCH 100/105] Update README.es.md --- exercises/19-Bottles-Of-Milk/README.es.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/19-Bottles-Of-Milk/README.es.md b/exercises/19-Bottles-Of-Milk/README.es.md index 992e248a..3df3fb1e 100644 --- a/exercises/19-Bottles-Of-Milk/README.es.md +++ b/exercises/19-Bottles-Of-Milk/README.es.md @@ -36,4 +36,4 @@ Go to the store and buy some more, 99 bottles of milk on the wall. + Al final de la canción, la letra cambia porque es solo una botella (singular en lugar del plural). -+ Lee la última parte de la letra y verás como cambia la última línea a `"Go to the store and by some more, 99 bottles of milk on the wall."`. ++ Lee la última parte de la letra y verás como cambia la última línea a `"Go to the store and buy some more, 99 bottles of milk on the wall."`. From e6a8af8eb26db34cd72bfacc29ab039adc22e18e Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 18:27:15 +0100 Subject: [PATCH 101/105] Update README.md --- exercises/19-Bottles-Of-Milk/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/19-Bottles-Of-Milk/README.md b/exercises/19-Bottles-Of-Milk/README.md index 410a5a6a..ce4d00c1 100644 --- a/exercises/19-Bottles-Of-Milk/README.md +++ b/exercises/19-Bottles-Of-Milk/README.md @@ -40,4 +40,4 @@ Go to the store and buy some more, 99 bottles of milk on the wall. + At the end of the song, the lyrics change because there is only **one** bottle (singular instead of plural). -+ Read the last lyrics, and you will see how the last line changes to `"Go to the store and by some more, 99 bottles of milk on the wall."`. ++ Read the last lyrics, and you will see how the last line changes to `"Go to the store and buy some more, 99 bottles of milk on the wall."`. From 48728ff0861618363607a93cb5519a2cd3635a4d Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 21:41:58 +0100 Subject: [PATCH 102/105] Update README.es.md --- exercises/11-Create-A-New-Function/README.es.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/11-Create-A-New-Function/README.es.md b/exercises/11-Create-A-New-Function/README.es.md index e1e45372..05923095 100644 --- a/exercises/11-Create-A-New-Function/README.es.md +++ b/exercises/11-Create-A-New-Function/README.es.md @@ -13,7 +13,7 @@ Pero Python viene con un conjunto de funciones "pre-definidas" que puedes usar, ```py import random -# Genera un número aleatorio dentro de un rango posiivo dado +# Genera un número aleatorio dentro de un rango positivo dado r1 = random.randint(0, 10) print("Random number between 0 and 10 is % s" % (r1)) From 4679f273d3ca4e33334caf0a40dbbbb361e414be Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 21:54:53 +0100 Subject: [PATCH 103/105] Update solution.hide.py --- exercises/18-The-Beatles/solution.hide.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/exercises/18-The-Beatles/solution.hide.py b/exercises/18-The-Beatles/solution.hide.py index c3a33816..49901bf0 100644 --- a/exercises/18-The-Beatles/solution.hide.py +++ b/exercises/18-The-Beatles/solution.hide.py @@ -1,13 +1,12 @@ # ✅↓ Write your code here ↓✅ def sing(): - song = "" for i in range(11): if i == 4: - song += "there will be an answer,\n" + print("there will be an answer,") elif i == 10: - song += "whisper words of wisdom, let it be" + print("whisper words of wisdom, let it be") else: - song += "let it be,\n" - return song + print("let it be,") + return None -print(sing()) +sing() From f0443fca6c8c1fd6880f89d0773eb19526a06616 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 21:57:11 +0100 Subject: [PATCH 104/105] Update README.md --- exercises/18-The-Beatles/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/18-The-Beatles/README.md b/exercises/18-The-Beatles/README.md index 304cfb29..10fa952b 100644 --- a/exercises/18-The-Beatles/README.md +++ b/exercises/18-The-Beatles/README.md @@ -18,7 +18,9 @@ This is the chorus of one of the most famous Beatles songs: ## 📝 Instructions: -1. Create a function called `sing()` that returns a string with the lyrics that you can hear from 3:21 sec to the end of the song at 3:50 sec https://www.youtube.com/watch?v=QDYfEBY9NM4 +1. Create a function called `sing()` that prints on the console the lyrics that you can hear from 3:21 sec to the end of the song at 3:50 sec https://www.youtube.com/watch?v=QDYfEBY9NM4 + +2. Call your function at the end. ## 💻 Expected output: @@ -40,6 +42,4 @@ whisper words of wisdom, let it be + The words "let it be" repeat all the time, you should probably create a loop for that. -+ To make a line jump in a string, you must insert the following characters inside your string `\n`. For example, `"let it be,\n"`. Now when you print your string in the console, you will visualize it better if you need to. - + If you need a refresher on loops and conditionals, check out this awesome resource: https://docs.python.org/3/tutorial/controlflow.html From fcd7bdb05c20ddf71dd953df44ff40c326a8fc85 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 22 Nov 2023 21:59:18 +0100 Subject: [PATCH 105/105] Update README.es.md --- exercises/18-The-Beatles/README.es.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/18-The-Beatles/README.es.md b/exercises/18-The-Beatles/README.es.md index 39821d20..d0fa4cf3 100644 --- a/exercises/18-The-Beatles/README.es.md +++ b/exercises/18-The-Beatles/README.es.md @@ -14,7 +14,9 @@ Este es el coro de una de las canciones más famosas de la banda: ## 📝 Instrucciones: -1. Crea una función llamada `sing()` que retorne un string con la misma letra que puedes escuchar desde el segundo 3:21 hasta el final de la canción en el segundo 3:50 https://www.youtube.com/watch?v=QDYfEBY9NM4 +1. Crea una función llamada `sing()` que imprima en consola la misma letra que puedes escuchar desde el segundo 3:21 hasta el final de la canción en el segundo 3:50 https://www.youtube.com/watch?v=QDYfEBY9NM4 + +2. Llama tu función al final del código. ## 💻 Resultado esperado: @@ -36,6 +38,4 @@ whisper words of wisdom, let it be + La frase "let it be" se repite todo el tiempo. Probablemente, deberías usar un bucle o loop para eso. 😊 -+ Para hacer un salto de línea en un string debes insertar los siguientes caracteres dentro del string `\n`. Por ejemplo, `"let it be,\n"`. Ahora cuando imprimas tu string en la consola lo podrás visualizar mejor si lo necesitas. - + Si necesitas un repaso sobre los loops y/o condicionales, échale un vistazo a esto: https://docs.python.org/es/3/tutorial/controlflow.html