From 7293f5d81ce1c6466433955d699e08f1c6a4d853 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 12:59:31 +0100 Subject: [PATCH 01/49] Update README.md --- exercises/24-class-with-two-methods/README.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/exercises/24-class-with-two-methods/README.md b/exercises/24-class-with-two-methods/README.md index 3971f14f..b08c3b4b 100644 --- a/exercises/24-class-with-two-methods/README.md +++ b/exercises/24-class-with-two-methods/README.md @@ -1,9 +1,7 @@ # `24` Class with two methods -Define a class which has at least two methods: -getString: to get a string from console input -printString: to print the string in upper case. -Also please include simple test function to test the class methods. +## 📝 Instructions: -Hints: -Use __init__ method to construct some parameters \ No newline at end of file +1. Define a class called `MyClass` which has at least two methods: ++ `get_string` to get a string from console input. ++ `print_string` to print the string in upper case. From b8bd2ab3610d5ad29ad9562e235630258bbc5c95 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 13:02:27 +0100 Subject: [PATCH 02/49] Update README.md --- exercises/24-class-with-two-methods/README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/exercises/24-class-with-two-methods/README.md b/exercises/24-class-with-two-methods/README.md index b08c3b4b..c97348c5 100644 --- a/exercises/24-class-with-two-methods/README.md +++ b/exercises/24-class-with-two-methods/README.md @@ -5,3 +5,7 @@ 1. Define a class called `MyClass` which has at least two methods: + `get_string` to get a string from console input. + `print_string` to print the string in upper case. + +## 💡 Hint: + ++ Use the `__init__` method to construct some parameters. From 4e885bde6d8905fd3da1e271182643935055f475 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 13:07:07 +0100 Subject: [PATCH 03/49] Update README.md --- exercises/24-class-with-two-methods/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/24-class-with-two-methods/README.md b/exercises/24-class-with-two-methods/README.md index c97348c5..fe7528e3 100644 --- a/exercises/24-class-with-two-methods/README.md +++ b/exercises/24-class-with-two-methods/README.md @@ -8,4 +8,4 @@ ## 💡 Hint: -+ Use the `__init__` method to construct some parameters. ++ Use the `__init__` method to construct your parameters. From 91f258ecc2607d4b9c56858750ef1be2d840774e Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 13:09:06 +0100 Subject: [PATCH 04/49] Update README.es.md --- .../24-class-with-two-methods/README.es.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/exercises/24-class-with-two-methods/README.es.md b/exercises/24-class-with-two-methods/README.es.md index fffb54ba..fe32dcd5 100644 --- a/exercises/24-class-with-two-methods/README.es.md +++ b/exercises/24-class-with-two-methods/README.es.md @@ -1,10 +1,11 @@ # `24` Una clase con dos métodos -Define una clase que tenga al menos dos métodos: -Define a class which has at least two methods: -getString: obtener un string desde la entrada de la consola. -printString: imprimir el string en mayúscula. -Por favor incluye una función simple de prueba para probar los métodos de la clase. - -Pistas: -Usa el método __init__ para construir algunos parámetros. \ No newline at end of file +## 📝 Instrucciones: + +1. Define una clase llamada `MyClass` que tenga al menos dos métodos: ++ `get_string` para obtener un string de entrada desde la consola. ++ `print_string` para imprimir el string obtenido en mayúsculas. + +## 💡 Pista: + ++ Usa el método __init__ para construir tus parámetros. From 2ef8e08e1d885012d53c60834ce3bee0f2ba931e Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 13:09:22 +0100 Subject: [PATCH 05/49] Update README.es.md --- exercises/24-class-with-two-methods/README.es.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/24-class-with-two-methods/README.es.md b/exercises/24-class-with-two-methods/README.es.md index fe32dcd5..b15c15f0 100644 --- a/exercises/24-class-with-two-methods/README.es.md +++ b/exercises/24-class-with-two-methods/README.es.md @@ -1,4 +1,4 @@ -# `24` Una clase con dos métodos +# `24` Class with two methods ## 📝 Instrucciones: From 705c6e90a1bb139147ce3cd31a4e59d5a9a71bb2 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 13:09:35 +0100 Subject: [PATCH 06/49] Update app.py --- exercises/24-class-with-two-methods/app.py | 1 + 1 file changed, 1 insertion(+) diff --git a/exercises/24-class-with-two-methods/app.py b/exercises/24-class-with-two-methods/app.py index e69de29b..a51f0856 100644 --- a/exercises/24-class-with-two-methods/app.py +++ b/exercises/24-class-with-two-methods/app.py @@ -0,0 +1 @@ +# Your code here From 6c35a1a9ef801bc78f0b632f3378d17b96c28c7c Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 13:13:39 +0100 Subject: [PATCH 07/49] Update README.md --- exercises/24-class-with-two-methods/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/24-class-with-two-methods/README.md b/exercises/24-class-with-two-methods/README.md index fe7528e3..5ac356fb 100644 --- a/exercises/24-class-with-two-methods/README.md +++ b/exercises/24-class-with-two-methods/README.md @@ -2,7 +2,7 @@ ## 📝 Instructions: -1. Define a class called `MyClass` which has at least two methods: +1. Define a class called `InputOutString` which has at least two methods: + `get_string` to get a string from console input. + `print_string` to print the string in upper case. From ab9322d9085fe937b3d7faa4732114a6169c8cb4 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 13:13:45 +0100 Subject: [PATCH 08/49] Update README.es.md --- exercises/24-class-with-two-methods/README.es.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/24-class-with-two-methods/README.es.md b/exercises/24-class-with-two-methods/README.es.md index b15c15f0..1b50dee5 100644 --- a/exercises/24-class-with-two-methods/README.es.md +++ b/exercises/24-class-with-two-methods/README.es.md @@ -2,7 +2,7 @@ ## 📝 Instrucciones: -1. Define una clase llamada `MyClass` que tenga al menos dos métodos: +1. Define una clase llamada `InputOutString` que tenga al menos dos métodos: + `get_string` para obtener un string de entrada desde la consola. + `print_string` para imprimir el string obtenido en mayúsculas. From 8aa439a3bdf86ec8292108a9eac7a82d388a1e86 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 13:15:35 +0100 Subject: [PATCH 09/49] Update solution.hide.py --- .../24-class-with-two-methods/solution.hide.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/exercises/24-class-with-two-methods/solution.hide.py b/exercises/24-class-with-two-methods/solution.hide.py index b6917e80..bcb910a2 100644 --- a/exercises/24-class-with-two-methods/solution.hide.py +++ b/exercises/24-class-with-two-methods/solution.hide.py @@ -1,13 +1,13 @@ -class InputOutString(object): +class InputOutString: def __init__(self): - self.s = "" + self.input_string = "" - def getString(self): - self.s = raw_input() + def get_string(self): + self.input_string = input("Enter a string: ") - def printString(self): - print self.s.upper() + def print_string(self): + print(self.input_string.upper()) -strObj = InputOutString() -strObj.getString() -strObj.printString() \ No newline at end of file +string_object = MyClass() +string_object.get_string() +string_object.print_string() From 48c1c3a43ac2eca95ebc9fd0fe6aa09837922d45 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 13:17:07 +0100 Subject: [PATCH 10/49] Update README.md --- exercises/24-class-with-two-methods/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/exercises/24-class-with-two-methods/README.md b/exercises/24-class-with-two-methods/README.md index 5ac356fb..99a82215 100644 --- a/exercises/24-class-with-two-methods/README.md +++ b/exercises/24-class-with-two-methods/README.md @@ -6,6 +6,8 @@ + `get_string` to get a string from console input. + `print_string` to print the string in upper case. +2. Test your class' methods. + ## 💡 Hint: + Use the `__init__` method to construct your parameters. From 64dfa03c7910e06d19b918bdd3f031b637adc1b1 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 13:17:57 +0100 Subject: [PATCH 11/49] Update README.es.md --- exercises/24-class-with-two-methods/README.es.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/exercises/24-class-with-two-methods/README.es.md b/exercises/24-class-with-two-methods/README.es.md index 1b50dee5..fe7c5c59 100644 --- a/exercises/24-class-with-two-methods/README.es.md +++ b/exercises/24-class-with-two-methods/README.es.md @@ -6,6 +6,8 @@ + `get_string` para obtener un string de entrada desde la consola. + `print_string` para imprimir el string obtenido en mayúsculas. +2. Prueba los métodos de tu clase. + ## 💡 Pista: -+ Usa el método __init__ para construir tus parámetros. ++ Usa el método `__init__` para construir tus parámetros. From 7ca65bfd6b6c637cea45075755941774298305b3 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 13:18:22 +0100 Subject: [PATCH 12/49] Update solution.hide.py --- exercises/24-class-with-two-methods/solution.hide.py | 1 + 1 file changed, 1 insertion(+) diff --git a/exercises/24-class-with-two-methods/solution.hide.py b/exercises/24-class-with-two-methods/solution.hide.py index bcb910a2..31f22239 100644 --- a/exercises/24-class-with-two-methods/solution.hide.py +++ b/exercises/24-class-with-two-methods/solution.hide.py @@ -1,3 +1,4 @@ +# Your code here class InputOutString: def __init__(self): self.input_string = "" From 0d98b29912e524dd386adb2f0082354285d9426d Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 13:39:45 +0100 Subject: [PATCH 13/49] Update README.md --- exercises/25-print-formula/README.md | 40 +++++++++++++++++----------- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/exercises/25-print-formula/README.md b/exercises/25-print-formula/README.md index b47224b0..cb145419 100644 --- a/exercises/25-print-formula/README.md +++ b/exercises/25-print-formula/README.md @@ -1,17 +1,27 @@ # `25` Print formula -Write a program that calculates and prints the value according to the given formula: -Q = Square root of [(2 * C * D)/H] - -Following are the fixed values of C and H: -C is 50. H is 30. -D is the variable whose values should be input to your program in a comma-separated sequence. -Example -Let us assume the following comma separated input sequence is given to the program: -100,150,180 -The output of the program should be: -18,22,24 - -Hints: -If the output received is in decimal form, it should be rounded off to its nearest value (for example, if the output received is 26.0, it should be printed as 26) -In case of input data being supplied to the question, it should be assumed to be a console input. \ No newline at end of file +## 📝 Instructions: + +1. Write a function `print_formula()` that calculates and prints the value according to the given formula: `Q = Square root of (2 * c * d) / h` + +*Following are the fixed values of `c` and `h`:* + ++ `c` is 50. ++ `h` is 30. ++ `d` is the variable whose values should be input to your program in a comma-separated sequence. + +## 📎 Example input: + +```py +print_formula(150) +``` + +## 📎 Example output: + +```py +22 +``` + +## 💡 Hint: + ++ If the output received is in decimal form, it should be rounded off to its nearest value (for example, if the output received is 26.0, it should be printed as 26). From ca5794fc5a515688f0d4177005047e0fd394074e Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 13:40:11 +0100 Subject: [PATCH 14/49] Update README.md --- exercises/25-print-formula/README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/exercises/25-print-formula/README.md b/exercises/25-print-formula/README.md index cb145419..498dea4a 100644 --- a/exercises/25-print-formula/README.md +++ b/exercises/25-print-formula/README.md @@ -2,7 +2,11 @@ ## 📝 Instructions: -1. Write a function `print_formula()` that calculates and prints the value according to the given formula: `Q = Square root of (2 * c * d) / h` +1. Write a function `print_formula()` that calculates and prints the value according to the given formula: + +```text +Q = Square root of (2 * c * d) / h` +``` *Following are the fixed values of `c` and `h`:* From 5019629f410ed1e04bb2b7b4bb82e2e6fdfb22cd Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 13:40:19 +0100 Subject: [PATCH 15/49] Update README.md --- exercises/25-print-formula/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/25-print-formula/README.md b/exercises/25-print-formula/README.md index 498dea4a..2cde1c74 100644 --- a/exercises/25-print-formula/README.md +++ b/exercises/25-print-formula/README.md @@ -5,7 +5,7 @@ 1. Write a function `print_formula()` that calculates and prints the value according to the given formula: ```text -Q = Square root of (2 * c * d) / h` +Q = Square root of (2 * c * d) / h ``` *Following are the fixed values of `c` and `h`:* From 7b8812c5ec8b0f5737dfb9eebeacbb90641a158a Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 13:50:14 +0100 Subject: [PATCH 16/49] Update solution.hide.py --- exercises/25-print-formula/solution.hide.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/exercises/25-print-formula/solution.hide.py b/exercises/25-print-formula/solution.hide.py index 10c47e5b..2669050f 100644 --- a/exercises/25-print-formula/solution.hide.py +++ b/exercises/25-print-formula/solution.hide.py @@ -1,5 +1,6 @@ import math + def print_formula(num): - return round(math.sqrt(2*50*num/30)) + return round(math.sqrt(2 * 50 * num / 30)) -print(print_formula(5)) \ No newline at end of file +print(print_formula(150)) From 2e6c15f4d4a1135fcdabe3c77fc1922f979fc203 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 13:52:35 +0100 Subject: [PATCH 17/49] Update README.md --- exercises/25-print-formula/README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/exercises/25-print-formula/README.md b/exercises/25-print-formula/README.md index 2cde1c74..0abc0f7a 100644 --- a/exercises/25-print-formula/README.md +++ b/exercises/25-print-formula/README.md @@ -2,7 +2,7 @@ ## 📝 Instructions: -1. Write a function `print_formula()` that calculates and prints the value according to the given formula: +1. Write a function `print_formula()`, with one parameter that calculates and prints the value according to the given formula: ```text Q = Square root of (2 * c * d) / h @@ -12,7 +12,7 @@ Q = Square root of (2 * c * d) / h + `c` is 50. + `h` is 30. -+ `d` is the variable whose values should be input to your program in a comma-separated sequence. ++ `d` would be the parameter of the function. ## 📎 Example input: @@ -26,6 +26,8 @@ print_formula(150) 22 ``` -## 💡 Hint: +## 💡 Hints: + If the output received is in decimal form, it should be rounded off to its nearest value (for example, if the output received is 26.0, it should be printed as 26). + ++ Import the `math` module. From 46581d67421c844ac49e8bd3df5ae78a1cd81dbd Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 13:52:57 +0100 Subject: [PATCH 18/49] Update solution.hide.py --- exercises/25-print-formula/solution.hide.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/25-print-formula/solution.hide.py b/exercises/25-print-formula/solution.hide.py index 2669050f..4ca5aae6 100644 --- a/exercises/25-print-formula/solution.hide.py +++ b/exercises/25-print-formula/solution.hide.py @@ -1,6 +1,6 @@ import math -def print_formula(num): - return round(math.sqrt(2 * 50 * num / 30)) +def print_formula(d): + return round(math.sqrt(2 * 50 * d / 30)) print(print_formula(150)) From 299a50f07ee8a3c3aa0b9681a0c8edd27a724516 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 13:54:10 +0100 Subject: [PATCH 19/49] Update test.py --- exercises/25-print-formula/test.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/exercises/25-print-formula/test.py b/exercises/25-print-formula/test.py index 27181781..0bb388ba 100644 --- a/exercises/25-print-formula/test.py +++ b/exercises/25-print-formula/test.py @@ -5,11 +5,11 @@ def test_function_existence(capsys, app): assert app.print_formula -@pytest.mark.it('The solution should work as expected') +@pytest.mark.it('The solution should work as expected. Testing with 100') def test_expected_output(capsys, app): - assert app.print_formula(100,150,180) == "18,22,24" + assert app.print_formula(100) == 18 -@pytest.mark.it('The solution should work as expected') +@pytest.mark.it('The solution should work as expected. Testing with 90') def test_another_output(capsys, app): - assert app.print_formula(200,90,300) == "26,17,32" + assert app.print_formula(90) == 17 From 9a77a1b15cc2a47390304341f5f4429f47c9bfd4 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 13:56:18 +0100 Subject: [PATCH 20/49] Update solution.hide.py --- exercises/25-print-formula/solution.hide.py | 1 + 1 file changed, 1 insertion(+) diff --git a/exercises/25-print-formula/solution.hide.py b/exercises/25-print-formula/solution.hide.py index 4ca5aae6..3ddcff9c 100644 --- a/exercises/25-print-formula/solution.hide.py +++ b/exercises/25-print-formula/solution.hide.py @@ -1,3 +1,4 @@ +# Your code here import math def print_formula(d): From 28da99997d174d6dabf637135894982b337c6ab2 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 13:56:27 +0100 Subject: [PATCH 21/49] Update app.py --- exercises/25-print-formula/app.py | 1 + 1 file changed, 1 insertion(+) diff --git a/exercises/25-print-formula/app.py b/exercises/25-print-formula/app.py index e69de29b..a51f0856 100644 --- a/exercises/25-print-formula/app.py +++ b/exercises/25-print-formula/app.py @@ -0,0 +1 @@ +# Your code here From 4dec33c14eac4fb67140cbc0d75cd1562fe05c96 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 14:04:02 +0100 Subject: [PATCH 22/49] Update README.es.md --- exercises/25-print-formula/README.es.md | 44 ++++++++++++++++--------- 1 file changed, 29 insertions(+), 15 deletions(-) diff --git a/exercises/25-print-formula/README.es.md b/exercises/25-print-formula/README.es.md index e38c0d3b..ff991494 100644 --- a/exercises/25-print-formula/README.es.md +++ b/exercises/25-print-formula/README.es.md @@ -1,19 +1,33 @@ -# `25` Imprime la fórmula +# `25` Print formula -Escribe un programa que calcule e imprima el valor de acuerdo a la fórmula dada: +## 📝 Instrucciones: -Q = Square root of [(2 * C * D)/H] +1. Escribe una función llamada `print_formula()`, con un parámetro que calcule e imprima el valor según la fórmula dada. -A continuación encontrarás los valores fijos de C y H: -C es 50. H es 30. -D es la variable cuyos valores debiesen ser ingresados en tu -Ejemplo: -Digamos que le sentrega la siguiente secuencia separada por coma al programa: -100,150,180 -El resultado del programa debiese ser: -18,22,24 +```text +Q = Square root of (2 * c * d) / h +``` -Pistas: -Si el resultado recicido es un decimal, debería rendondearse a su valor más cercano (por ejemplo, si el resultado es 26.0, debiese imprimirse como 26) -En el caso de que se le hayan entregado datos a la cuestión, deben asumirse como una entrada de la consola. - \ No newline at end of file +*A continuación encontrarás los valores fijos de `c` y `h`:* + ++ `c` es 50. ++ `h` es 30. ++ `d` sería el parámetro de la función. + +## 📎 Ejemplo de entrada: + +```py +print_formula(150) +``` + +## 📎 Ejemplo de salida: + +```py +22 +``` + +## 💡 Pistas: + ++ Si el resultado recibido es un decimal, debería rendondearse a su valor más cercano (por ejemplo, si el resultado es 26.0, debiese imprimirse como 26). + ++ Importa el módulo `math`. From 509a1ac538fe61f08c6e32631bc5e09e047514ce Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 14:07:16 +0100 Subject: [PATCH 23/49] Update README.es.md --- exercises/25-print-formula/README.es.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/25-print-formula/README.es.md b/exercises/25-print-formula/README.es.md index ff991494..4a6d7736 100644 --- a/exercises/25-print-formula/README.es.md +++ b/exercises/25-print-formula/README.es.md @@ -28,6 +28,6 @@ print_formula(150) ## 💡 Pistas: -+ Si el resultado recibido es un decimal, debería rendondearse a su valor más cercano (por ejemplo, si el resultado es 26.0, debiese imprimirse como 26). ++ Si el resultado recibido es un decimal, debería redondearse a su valor más cercano (por ejemplo, si el resultado es 26.0, debiese imprimirse como 26). + Importa el módulo `math`. From 807e5eb0ed67db97c864795547dbe321bf7401e7 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 14:23:48 +0100 Subject: [PATCH 24/49] Update README.md --- exercises/26-two-dimensional-array/README.md | 44 +++++++++++++++----- 1 file changed, 34 insertions(+), 10 deletions(-) diff --git a/exercises/26-two-dimensional-array/README.md b/exercises/26-two-dimensional-array/README.md index 330f75a5..b1ff923b 100644 --- a/exercises/26-two-dimensional-array/README.md +++ b/exercises/26-two-dimensional-array/README.md @@ -1,12 +1,36 @@ -# `26`Two dimensional array +# `26` Two dimensional array + +## 📝 Instructions: + +1. Write a program which takes 2 digits, X,Y as input and generates a 2-dimensional array. The element value in the i-th row and j-th column of the array should be i*j. -Write a program which takes 2 digits, X,Y as input and generates a 2-dimensional array. The element value in the i-th row and j-th column of the array should be i*j. Note: i=0,1.., X-1; j=0,1,¡­Y-1. -Example -Suppose the following inputs are given to the program: -3,5 -Then, the output of the program should be: -[[0, 0, 0, 0, 0], [0, 1, 2, 3, 4], [0, 2, 4, 6, 8]] - -Hints: -Note: In case of input data being supplied to the question, it should be assumed to be a console input in a comma-separated form. \ No newline at end of file + + +```text +Q = Square root of (2 * c * d) / h +``` + +*Following are the fixed values of `c` and `h`:* + ++ `c` is 50. ++ `h` is 30. ++ `d` would be the parameter of the function. + +## 📎 Example input: + +```py +two_dimensional_array(3,5) +``` + +## 📎 Example output: + +```py +[[0, 0, 0, 0, 0], [0, 1, 2, 3, 4], [0, 2, 4, 6, 8]] +``` + +## 💡 Hints: + ++ If the output received is in decimal form, it should be rounded off to its nearest value (for example, if the output received is 26.0, it should be printed as 26). + ++ Import the `math` module. From e31f654dbd29bfcba629d6a17c0a1f1c32490cc5 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 16:29:49 +0100 Subject: [PATCH 25/49] Update README.md --- exercises/26-two-dimensional-array/README.md | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/exercises/26-two-dimensional-array/README.md b/exercises/26-two-dimensional-array/README.md index b1ff923b..5fb291c5 100644 --- a/exercises/26-two-dimensional-array/README.md +++ b/exercises/26-two-dimensional-array/README.md @@ -2,20 +2,9 @@ ## 📝 Instructions: -1. Write a program which takes 2 digits, X,Y as input and generates a 2-dimensional array. The element value in the i-th row and j-th column of the array should be i*j. +1. Write a function `two_dimensional_array`, which takes 2 digits (x, y) as input and generates a 2-dimensional array. -Note: i=0,1.., X-1; j=0,1,¡­Y-1. - - -```text -Q = Square root of (2 * c * d) / h -``` - -*Following are the fixed values of `c` and `h`:* - -+ `c` is 50. -+ `h` is 30. -+ `d` would be the parameter of the function. +2. The element value in the i-th row and j-th column of the array should be i*j (the index values). ## 📎 Example input: @@ -29,8 +18,3 @@ two_dimensional_array(3,5) [[0, 0, 0, 0, 0], [0, 1, 2, 3, 4], [0, 2, 4, 6, 8]] ``` -## 💡 Hints: - -+ If the output received is in decimal form, it should be rounded off to its nearest value (for example, if the output received is 26.0, it should be printed as 26). - -+ Import the `math` module. From 179e4b8723b925ea9437ffedb17538bad1047f9e Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 16:37:49 +0100 Subject: [PATCH 26/49] Update README.md --- exercises/26-two-dimensional-array/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/exercises/26-two-dimensional-array/README.md b/exercises/26-two-dimensional-array/README.md index 5fb291c5..78e329e3 100644 --- a/exercises/26-two-dimensional-array/README.md +++ b/exercises/26-two-dimensional-array/README.md @@ -1,15 +1,15 @@ -# `26` Two dimensional array +# `26` Two dimensional list ## 📝 Instructions: -1. Write a function `two_dimensional_array`, which takes 2 digits (x, y) as input and generates a 2-dimensional array. +1. Write a function `two_dimensional_list`, which takes 2 digits (x, y) as input and generates a 2-dimensional list. -2. The element value in the i-th row and j-th column of the array should be i*j (the index values). +2. The element value in the i-th row and j-th column of the list should be i*j (the index values). ## 📎 Example input: ```py -two_dimensional_array(3,5) +two_dimensional_list(3,5) ``` ## 📎 Example output: From abb91f5127bfbdb9ef24f9a234866e01189f9787 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 16:39:00 +0100 Subject: [PATCH 27/49] Update README.es.md --- .../26-two-dimensional-array/README.es.md | 26 ++++++++++++------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/exercises/26-two-dimensional-array/README.es.md b/exercises/26-two-dimensional-array/README.es.md index b81dd4a6..dc216ed9 100644 --- a/exercises/26-two-dimensional-array/README.es.md +++ b/exercises/26-two-dimensional-array/README.es.md @@ -1,13 +1,19 @@ -# `26` Array de dos dimensiones +# `26` Two dimensional list -Escribe un progrsms que reciba dos dígitos X,Y como entrada y genere un array de dos dimensiones. El valor del elemento en la fila i-th y en la columna j-th del array debiese ser i*j. -Nota: i=0,1.., X-1; j=0,1,¡­Y-1. -Ejemplo: -Supongamos que se le entregan lasa siguientes entradas al programa: -3,5 -Entonces, el resultado del programa debería ser: -[[0, 0, 0, 0, 0], [0, 1, 2, 3, 4], [0, 2, 4, 6, 8]] +## 📝 Instructions: -Pistas: -Nota: En el caso de que se le entreguen datos a la cuestión, debe asumirse como una entrada de la consola en un formulario separado por comas. +1. Escribe una función llamada `two_dimensional_list()` que tome 2 dígitos (x, y) como entrada y genere un lista bidimensional o matriz. +2. El valor del elemento en la fila `i` y columna `j` de la lista debería ser `i*j` (los valores de sus índices). + +## 📎 Example input: + +```py +two_dimensional_list(3,5) +``` + +## 📎 Example output: + +```py +[[0, 0, 0, 0, 0], [0, 1, 2, 3, 4], [0, 2, 4, 6, 8]] +``` From f5fc628a69954b0686c8c007599c30f87cbe7ef9 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 16:39:22 +0100 Subject: [PATCH 28/49] Update README.md --- exercises/26-two-dimensional-array/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/26-two-dimensional-array/README.md b/exercises/26-two-dimensional-array/README.md index 78e329e3..72c6e3ab 100644 --- a/exercises/26-two-dimensional-array/README.md +++ b/exercises/26-two-dimensional-array/README.md @@ -4,7 +4,7 @@ 1. Write a function `two_dimensional_list`, which takes 2 digits (x, y) as input and generates a 2-dimensional list. -2. The element value in the i-th row and j-th column of the list should be i*j (the index values). +2. The element value in the `i` row and `j` column of the list should be `i*j` (their index values). ## 📎 Example input: From 0592b5811d39c3ca2756c63f6c3f7b7ca27d7564 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 16:39:37 +0100 Subject: [PATCH 29/49] Update README.es.md --- exercises/26-two-dimensional-array/README.es.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/26-two-dimensional-array/README.es.md b/exercises/26-two-dimensional-array/README.es.md index dc216ed9..6fd637e2 100644 --- a/exercises/26-two-dimensional-array/README.es.md +++ b/exercises/26-two-dimensional-array/README.es.md @@ -1,6 +1,6 @@ # `26` Two dimensional list -## 📝 Instructions: +## 📝 Instrucciones: 1. Escribe una función llamada `two_dimensional_list()` que tome 2 dígitos (x, y) como entrada y genere un lista bidimensional o matriz. From e9846b7e55da34aca3f547b1fd1c13ba7f32227b Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 16:39:54 +0100 Subject: [PATCH 30/49] Update app.py --- exercises/26-two-dimensional-array/app.py | 1 + 1 file changed, 1 insertion(+) diff --git a/exercises/26-two-dimensional-array/app.py b/exercises/26-two-dimensional-array/app.py index e69de29b..a51f0856 100644 --- a/exercises/26-two-dimensional-array/app.py +++ b/exercises/26-two-dimensional-array/app.py @@ -0,0 +1 @@ +# Your code here From b306c283820c409bd95d5bd427eeaa6e32957c31 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 16:46:43 +0100 Subject: [PATCH 31/49] Update test.py --- exercises/26-two-dimensional-array/test.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/exercises/26-two-dimensional-array/test.py b/exercises/26-two-dimensional-array/test.py index 5cd0300c..42ca45a3 100644 --- a/exercises/26-two-dimensional-array/test.py +++ b/exercises/26-two-dimensional-array/test.py @@ -1,18 +1,17 @@ - import pytest,os,re,io,sys, mock, json -@pytest.mark.it('The function two_dimensional_array must exist') +@pytest.mark.it('The function two_dimensional_list must exist') def test_function_existence(capsys, app): - assert app.two_dimensional_array + assert app.two_dimensional_list -@pytest.mark.it('The function should return the expected output.') +@pytest.mark.it('The function should return the expected output') def test_expected_output(capsys, app): - assert app.two_dimensional_array(3,5) == [[0, 0, 0, 0, 0], [0, 1, 2, 3, 4], [0, 2, 4, 6, 8]] + assert app.two_dimensional_list(3,5) == [[0, 0, 0, 0, 0], [0, 1, 2, 3, 4], [0, 2, 4, 6, 8]] -@pytest.mark.it('The function should work with other entries. Testing with 2,7') +@pytest.mark.it('The function should work with other entries. Testing with 2, 7') def test_expected_output(capsys, app): - assert app.two_dimensional_array(2,7) == [[0, 0, 0, 0, 0, 0, 0], [0, 1, 2, 3, 4, 5, 6]] + assert app.two_dimensional_list(2,7) == [[0, 0, 0, 0, 0, 0, 0], [0, 1, 2, 3, 4, 5, 6]] -@pytest.mark.it('The function should work with other entries. Testing with 2,7') +@pytest.mark.it('The function should work with other entries. Testing with 1, 10') def test_expected_output(capsys, app): - assert app.two_dimensional_array(1,10) == [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]] + assert app.two_dimensional_list(1,10) == [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]] From dc76fbde9c27aa6bed5644a2da73d3b1fd95115a Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 16:49:41 +0100 Subject: [PATCH 32/49] Update solution.hide.py --- .../26-two-dimensional-array/solution.hide.py | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/exercises/26-two-dimensional-array/solution.hide.py b/exercises/26-two-dimensional-array/solution.hide.py index c1279fd2..190ac67e 100644 --- a/exercises/26-two-dimensional-array/solution.hide.py +++ b/exercises/26-two-dimensional-array/solution.hide.py @@ -1,11 +1,14 @@ -def two_dimensional_array(nList, nElements): - dimensions=[int(x) for x in "{},{}".format(nList,nElements).split(',')] - rowNum=dimensions[0] - colNum=dimensions[1] - multilist = [[0 for col in range(colNum)] for row in range(rowNum)] +# Your code here +def two_dimensional_list(n_rows, n_columns): + dimensions = [int(x) for x in "{},{}".format(n_rows, n_columns).split(',')] + row_num = dimensions[0] + col_num = dimensions[1] + matrix = [[0 for col in range(col_num)] for row in range(row_num)] - for row in range(rowNum): - for col in range(colNum): - multilist[row][col]= row*col + for row in range(row_num): + for col in range(col_num): + matrix[row][col] = row * col - return (multilist) + return matrix + +print(two_dimensional_list(3,5)) From 9d3fd141ab9107a5e21399a1272408ba8eea716e Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 16:49:51 +0100 Subject: [PATCH 33/49] Update README.md --- exercises/26-two-dimensional-array/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/26-two-dimensional-array/README.md b/exercises/26-two-dimensional-array/README.md index 72c6e3ab..1dc15ecd 100644 --- a/exercises/26-two-dimensional-array/README.md +++ b/exercises/26-two-dimensional-array/README.md @@ -2,7 +2,7 @@ ## 📝 Instructions: -1. Write a function `two_dimensional_list`, which takes 2 digits (x, y) as input and generates a 2-dimensional list. +1. Write a function `two_dimensional_list`, which takes 2 digits (x, y) as input and generates a 2-dimensional list or matrix. 2. The element value in the `i` row and `j` column of the list should be `i*j` (their index values). From 93f9ab78b04f4e917302be040cbe3e3eb9d20678 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 16:50:54 +0100 Subject: [PATCH 34/49] Update README.md --- exercises/26-two-dimensional-array/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/26-two-dimensional-array/README.md b/exercises/26-two-dimensional-array/README.md index 1dc15ecd..a70539c1 100644 --- a/exercises/26-two-dimensional-array/README.md +++ b/exercises/26-two-dimensional-array/README.md @@ -2,7 +2,7 @@ ## 📝 Instructions: -1. Write a function `two_dimensional_list`, which takes 2 digits (x, y) as input and generates a 2-dimensional list or matrix. +1. Write a function `two_dimensional_list`, that takes 2 digits (x, y) as input and generates a 2-dimensional list or matrix. 2. The element value in the `i` row and `j` column of the list should be `i*j` (their index values). From 5c3159b2308d11f7fe934fadccef2388c32adabf Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 16:51:43 +0100 Subject: [PATCH 35/49] Update README.es.md --- exercises/26-two-dimensional-array/README.es.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/26-two-dimensional-array/README.es.md b/exercises/26-two-dimensional-array/README.es.md index 6fd637e2..c6a0a771 100644 --- a/exercises/26-two-dimensional-array/README.es.md +++ b/exercises/26-two-dimensional-array/README.es.md @@ -2,17 +2,17 @@ ## 📝 Instrucciones: -1. Escribe una función llamada `two_dimensional_list()` que tome 2 dígitos (x, y) como entrada y genere un lista bidimensional o matriz. +1. Escribe una función llamada `two_dimensional_list()` que tome 2 dígitos (x, y) como entrada y genere una lista bidimensional o matriz. 2. El valor del elemento en la fila `i` y columna `j` de la lista debería ser `i*j` (los valores de sus índices). -## 📎 Example input: +## 📎 Ejemplo de entrada: ```py two_dimensional_list(3,5) ``` -## 📎 Example output: +## 📎 Ejemplo de salida: ```py [[0, 0, 0, 0, 0], [0, 1, 2, 3, 4], [0, 2, 4, 6, 8]] From 829f39610cbd4df4cf2cf8ee8e6921ec6ad263f4 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 16:52:07 +0100 Subject: [PATCH 36/49] Update test.py --- exercises/26-two-dimensional-array/test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/26-two-dimensional-array/test.py b/exercises/26-two-dimensional-array/test.py index 42ca45a3..833f3836 100644 --- a/exercises/26-two-dimensional-array/test.py +++ b/exercises/26-two-dimensional-array/test.py @@ -8,10 +8,10 @@ def test_function_existence(capsys, app): def test_expected_output(capsys, app): assert app.two_dimensional_list(3,5) == [[0, 0, 0, 0, 0], [0, 1, 2, 3, 4], [0, 2, 4, 6, 8]] -@pytest.mark.it('The function should work with other entries. Testing with 2, 7') +@pytest.mark.it('The function should work with other entries. Testing with (2, 7)') def test_expected_output(capsys, app): assert app.two_dimensional_list(2,7) == [[0, 0, 0, 0, 0, 0, 0], [0, 1, 2, 3, 4, 5, 6]] -@pytest.mark.it('The function should work with other entries. Testing with 1, 10') +@pytest.mark.it('The function should work with other entries. Testing with (1, 10)') def test_expected_output(capsys, app): assert app.two_dimensional_list(1,10) == [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]] From de16793bf67e0d7af4637d0b2da5b45872bb04ad Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 17:13:50 +0100 Subject: [PATCH 37/49] Update README.md --- exercises/27-sequence-of-words/README.md | 25 ++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/exercises/27-sequence-of-words/README.md b/exercises/27-sequence-of-words/README.md index be2f8cf0..c4cf381d 100644 --- a/exercises/27-sequence-of-words/README.md +++ b/exercises/27-sequence-of-words/README.md @@ -1,10 +1,19 @@ -# `27`Sequence of words +# `27` Sequence of words -Write a program that accepts a comma separated sequence of words as input and prints the words in a comma-separated sequence after sorting them alphabetically. -Suppose the following input is supplied to the program: -without,hello,bag,world -Then, the output should be: -bag,hello,without,world +## 📝 Instructions: -Hints: -In case of input data being supplied to the question, it should be assumed to be a console input. \ No newline at end of file +1. Write a function `two_dimensional_list`, that accepts a comma separated sequence of words as input. + +2. Print the words in a comma-separated sequence after sorting them alphabetically. + +## 📎 Example input: + +```py +(without,hello,bag,world) +``` + +## 📎 Example output: + +```py +bag, hello, without, world +``` From cf7c26f9932bf863c313f7f6a8c45b0ab0a263ff Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 17:14:20 +0100 Subject: [PATCH 38/49] Update README.md --- exercises/27-sequence-of-words/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/27-sequence-of-words/README.md b/exercises/27-sequence-of-words/README.md index c4cf381d..c823fbe6 100644 --- a/exercises/27-sequence-of-words/README.md +++ b/exercises/27-sequence-of-words/README.md @@ -2,14 +2,14 @@ ## 📝 Instructions: -1. Write a function `two_dimensional_list`, that accepts a comma separated sequence of words as input. +1. Write a function `sequence_of_words`, that accepts a comma separated sequence of words as input. 2. Print the words in a comma-separated sequence after sorting them alphabetically. ## 📎 Example input: ```py -(without,hello,bag,world) +sequence_of_words(without,hello,bag,world) ``` ## 📎 Example output: From 9154e2f7eec3ea898790f22431ceeb608fe47fbe Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 17:17:06 +0100 Subject: [PATCH 39/49] Update app.py --- exercises/27-sequence-of-words/app.py | 1 + 1 file changed, 1 insertion(+) diff --git a/exercises/27-sequence-of-words/app.py b/exercises/27-sequence-of-words/app.py index e69de29b..a51f0856 100644 --- a/exercises/27-sequence-of-words/app.py +++ b/exercises/27-sequence-of-words/app.py @@ -0,0 +1 @@ +# Your code here From e84c78a27833265281b4e8784ed3365219350945 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 17:18:22 +0100 Subject: [PATCH 40/49] Update test.py --- exercises/27-sequence-of-words/test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/27-sequence-of-words/test.py b/exercises/27-sequence-of-words/test.py index b48ffb1d..0b82f45e 100644 --- a/exercises/27-sequence-of-words/test.py +++ b/exercises/27-sequence-of-words/test.py @@ -9,6 +9,6 @@ def test_function_existence(capsys, app): def test_function_existence(capsys, app): assert app.sequence_of_words("bag,hello,without,world") == "bag,hello,without,world" -@pytest.mark.it('The function should return the expected output') +@pytest.mark.it('The function should return the expected output. Testing with different values') def test_function_existence(capsys, app): - assert app.sequence_of_words("No,pain,gain") == "No,gain,pain" \ No newline at end of file + assert app.sequence_of_words("No,pain,gain") == "No,gain,pain" From d2357f43ea2218245ebabc8690efbad24e7e5113 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 17:29:48 +0100 Subject: [PATCH 41/49] Update README.md --- exercises/27-sequence-of-words/README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/exercises/27-sequence-of-words/README.md b/exercises/27-sequence-of-words/README.md index c823fbe6..f6246c5a 100644 --- a/exercises/27-sequence-of-words/README.md +++ b/exercises/27-sequence-of-words/README.md @@ -9,7 +9,7 @@ ## 📎 Example input: ```py -sequence_of_words(without,hello,bag,world) +sequence_of_words("without,hello,bag,world") ``` ## 📎 Example output: @@ -17,3 +17,7 @@ sequence_of_words(without,hello,bag,world) ```py bag, hello, without, world ``` + +## 💡 Hint: + ++ Remember that each word must be separated by a comma and inside one pair of quotes. From 9749fe9a467dd557d649caa80c9ac3dd3d084844 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 17:30:20 +0100 Subject: [PATCH 42/49] Update README.md --- exercises/27-sequence-of-words/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/27-sequence-of-words/README.md b/exercises/27-sequence-of-words/README.md index f6246c5a..9638d62f 100644 --- a/exercises/27-sequence-of-words/README.md +++ b/exercises/27-sequence-of-words/README.md @@ -2,7 +2,7 @@ ## 📝 Instructions: -1. Write a function `sequence_of_words`, that accepts a comma separated sequence of words as input. +1. Write a function `sequence_of_words`, that accepts a comma separated sequence of words as input (one string). 2. Print the words in a comma-separated sequence after sorting them alphabetically. From f2ba6367dfe648b7853202e6719ef83909d55075 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 17:31:29 +0100 Subject: [PATCH 43/49] Update README.md --- exercises/26-two-dimensional-array/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/26-two-dimensional-array/README.md b/exercises/26-two-dimensional-array/README.md index a70539c1..eed36f28 100644 --- a/exercises/26-two-dimensional-array/README.md +++ b/exercises/26-two-dimensional-array/README.md @@ -2,7 +2,7 @@ ## 📝 Instructions: -1. Write a function `two_dimensional_list`, that takes 2 digits (x, y) as input and generates a 2-dimensional list or matrix. +1. Write a function `two_dimensional_list()`, that takes 2 digits (x, y) as input and generates a 2-dimensional list or matrix. 2. The element value in the `i` row and `j` column of the list should be `i*j` (their index values). From 94413bf9729a51aa2fb8e6f1d74b3cf0c64af931 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 17:36:05 +0100 Subject: [PATCH 44/49] Update README.es.md --- exercises/27-sequence-of-words/README.es.md | 29 +++++++++++++++------ 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/exercises/27-sequence-of-words/README.es.md b/exercises/27-sequence-of-words/README.es.md index 290fdecf..6f8b5411 100644 --- a/exercises/27-sequence-of-words/README.es.md +++ b/exercises/27-sequence-of-words/README.es.md @@ -1,10 +1,23 @@ # `27` Secuencia de palabras -Escribe un programa que acepte una secuencia separada por comas como entrada e imprima las palabras en una secuencia separada por comas después de ordenarlas alfabéticamente. -Supongamos que se le entrega la siguiente entrada al programa: -without,hello,bag,world -El resultado debiese ser: -bag,hello,without,world - -Pistas: -En el caso de que se le entreguen datos a la pregunta, deben considerarse como entradas de la consola. +## 📝 Instrucciones: + +1. Escribe una función llamada `sequence_of_words()`, que acepte una secuencia de palabras separadas por comas como entrada (un string). + +2. Imprime las palabras en una secuencia separada por comas después de ordenarlas alfabéticamente. + +## 📎 Ejemplo de entrada: + +```py +sequence_of_words("without,hello,bag,world") +``` + +## 📎 Ejemplo de salida: + +```py +bag, hello, without, world +``` + +## 💡 Pista: + ++ Recuerda que cada palabra debe estar separada por una coma y dentro de UN SOLO par de comillas. From ca9b35b2293ea9397e6f0a825bd6b7b93546837f Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 17:36:19 +0100 Subject: [PATCH 45/49] Update README.md --- exercises/27-sequence-of-words/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/27-sequence-of-words/README.md b/exercises/27-sequence-of-words/README.md index 9638d62f..03f139db 100644 --- a/exercises/27-sequence-of-words/README.md +++ b/exercises/27-sequence-of-words/README.md @@ -20,4 +20,4 @@ bag, hello, without, world ## 💡 Hint: -+ Remember that each word must be separated by a comma and inside one pair of quotes. ++ Remember that each word must be separated by a comma and inside ONLY ONE pair of quotes. From 152aaf98d9ec92ff488b6b4106509301b6f5c729 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 17:36:39 +0100 Subject: [PATCH 46/49] Update README.md --- exercises/27-sequence-of-words/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/27-sequence-of-words/README.md b/exercises/27-sequence-of-words/README.md index 03f139db..3cacba0b 100644 --- a/exercises/27-sequence-of-words/README.md +++ b/exercises/27-sequence-of-words/README.md @@ -2,7 +2,7 @@ ## 📝 Instructions: -1. Write a function `sequence_of_words`, that accepts a comma separated sequence of words as input (one string). +1. Write a function `sequence_of_words`, that accepts a comma separated sequence of words as input (a string). 2. Print the words in a comma-separated sequence after sorting them alphabetically. From eb9ff26840fee2e19ac079e2fc74c69d6c981faf Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 17:37:58 +0100 Subject: [PATCH 47/49] Update solution.hide.py --- exercises/27-sequence-of-words/solution.hide.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/exercises/27-sequence-of-words/solution.hide.py b/exercises/27-sequence-of-words/solution.hide.py index 75bddc17..71949469 100644 --- a/exercises/27-sequence-of-words/solution.hide.py +++ b/exercises/27-sequence-of-words/solution.hide.py @@ -1,4 +1,7 @@ +# Your code here def sequence_of_words(words): items=[x for x in "{}".format(words).split(',')] items.sort() return (','.join(items)) + +print(sequence_of_words("this,is,sorted")) From 18165ecf364da1e48d871c432060e4e607bc5a67 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 17:38:34 +0100 Subject: [PATCH 48/49] Update README.es.md --- exercises/27-sequence-of-words/README.es.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/27-sequence-of-words/README.es.md b/exercises/27-sequence-of-words/README.es.md index 6f8b5411..05255296 100644 --- a/exercises/27-sequence-of-words/README.es.md +++ b/exercises/27-sequence-of-words/README.es.md @@ -1,4 +1,4 @@ -# `27` Secuencia de palabras +# `27` Sequence of words ## 📝 Instrucciones: From 24ee78f303d465efa977a5c9027179a1b4fa6b22 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 17:42:44 +0100 Subject: [PATCH 49/49] Update solution.hide.py --- exercises/24-class-with-two-methods/solution.hide.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/24-class-with-two-methods/solution.hide.py b/exercises/24-class-with-two-methods/solution.hide.py index 31f22239..e53abdf1 100644 --- a/exercises/24-class-with-two-methods/solution.hide.py +++ b/exercises/24-class-with-two-methods/solution.hide.py @@ -9,6 +9,6 @@ def get_string(self): def print_string(self): print(self.input_string.upper()) -string_object = MyClass() +string_object = InputOutString() string_object.get_string() string_object.print_string()