From 1cb917a73691c8227356612196ee0f491b319851 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 08:43:13 +0100 Subject: [PATCH 01/65] Update README.md --- exercises/28-sequence-of-lines/README.md | 29 ++++++++++++++---------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/exercises/28-sequence-of-lines/README.md b/exercises/28-sequence-of-lines/README.md index 1efba3f5..b3395056 100644 --- a/exercises/28-sequence-of-lines/README.md +++ b/exercises/28-sequence-of-lines/README.md @@ -1,14 +1,19 @@ # `28` Sequence of lines -Write a program that accepts sequence of lines as input and prints the lines after making all characters in the sentence capitalized. -Suppose the following input is supplied to the program: -Hello world -Practice makes perfect -Then, the output should be: -HELLO WORLD -PRACTICE MAKES PERFECT - -Hints: -In case of input data being supplied to the question, it should be assumed to be a console input. - -Solution: +Write a function `lines()`. Given a string, make the function return the all characters from the string capitalized. + +📎 Example input: + +```py +lines("Hello world, practice makes perfect") +``` + +📎 Example output: + +```text +HELLO WORLD, PRACTICE MAKES PERFECT +``` + +💡 Hint: + ++ Search in Google how to capitalize a string. From 9f43e7b19c8778452b241846d5ab729defaaaa28 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 08:44:36 +0100 Subject: [PATCH 02/65] Update README.md --- exercises/28-sequence-of-lines/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/28-sequence-of-lines/README.md b/exercises/28-sequence-of-lines/README.md index b3395056..483ff138 100644 --- a/exercises/28-sequence-of-lines/README.md +++ b/exercises/28-sequence-of-lines/README.md @@ -1,6 +1,6 @@ # `28` Sequence of lines -Write a function `lines()`. Given a string, make the function return the all characters from the string capitalized. +Write a function `lines()`. Given a string, make the function return all the characters from the string capitalized. 📎 Example input: @@ -16,4 +16,4 @@ HELLO WORLD, PRACTICE MAKES PERFECT 💡 Hint: -+ Search in Google how to capitalize a string. ++ Google how to capitalize a string. From 1efb3fc469faa33e3e5a4e863e6a24589cdb5fd5 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 08:45:00 +0100 Subject: [PATCH 03/65] Update README.md --- exercises/28-sequence-of-lines/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/28-sequence-of-lines/README.md b/exercises/28-sequence-of-lines/README.md index 483ff138..cf9c0c8c 100644 --- a/exercises/28-sequence-of-lines/README.md +++ b/exercises/28-sequence-of-lines/README.md @@ -16,4 +16,4 @@ HELLO WORLD, PRACTICE MAKES PERFECT 💡 Hint: -+ Google how to capitalize a string. ++ Google how to capitalize a string in Python. From 00c3fe6c3eb2a8b62fab24cd08b02184d01e3ba4 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 08:46:13 +0100 Subject: [PATCH 04/65] Update README.md --- exercises/28-sequence-of-lines/README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/exercises/28-sequence-of-lines/README.md b/exercises/28-sequence-of-lines/README.md index cf9c0c8c..fab46cc5 100644 --- a/exercises/28-sequence-of-lines/README.md +++ b/exercises/28-sequence-of-lines/README.md @@ -1,19 +1,21 @@ # `28` Sequence of lines -Write a function `lines()`. Given a string, make the function return all the characters from the string capitalized. +## 📝 Instructions: -📎 Example input: +1. Write a function `lines()`. Given a string, make the function return all the characters from the string capitalized. + +## 📎 Example input: ```py lines("Hello world, practice makes perfect") ``` -📎 Example output: +## 📎 Example output: ```text HELLO WORLD, PRACTICE MAKES PERFECT ``` -💡 Hint: +## 💡 Hint: + Google how to capitalize a string in Python. From 089413c31860321f2ae254e861c491edcca77eac Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 08:55:33 +0100 Subject: [PATCH 05/65] Update README.es.md --- exercises/28-sequence-of-lines/README.es.md | 26 ++++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/exercises/28-sequence-of-lines/README.es.md b/exercises/28-sequence-of-lines/README.es.md index 50656af2..0c6b4728 100644 --- a/exercises/28-sequence-of-lines/README.es.md +++ b/exercises/28-sequence-of-lines/README.es.md @@ -1,13 +1,21 @@ # `28` Sequence of lines -Escribe un programa que acepte una secuencia de líneas como entrada y que luego imprima las líneas convirtiendo todos los caracteres en mayúscula. +## 📝 Instrucciones: -Supongamos le entregamos la siguiente entrada al programa: -Hello world -Practice makes perfect -El resultado debería ser este: -HELLO WORLD -PRACTICE MAKES PERFECT +1. Escribe la función `lines()`. Dado un string, haz que la función retorne todos los caracteres del string en mayúsculas. -Pistas: -En caso de que se le pasen entradas de datos a la pregunta, deben asumirse como entradas de la consola. +## 📎 Ejemplo de entrada: + +```py +lines("Hello world, practice makes perfect") +``` + +## 📎 Ejemplo de salida: + +```text +HELLO WORLD, PRACTICE MAKES PERFECT +``` + +## 💡 Pista: + ++ Googlea cómo convertir un string a mayúsculas en Python. From d516d24f5b9acf663a2066423b4b8bf5d94bb244 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 08:55:47 +0100 Subject: [PATCH 06/65] Update app.py --- exercises/28-sequence-of-lines/app.py | 1 + 1 file changed, 1 insertion(+) diff --git a/exercises/28-sequence-of-lines/app.py b/exercises/28-sequence-of-lines/app.py index e69de29b..a51f0856 100644 --- a/exercises/28-sequence-of-lines/app.py +++ b/exercises/28-sequence-of-lines/app.py @@ -0,0 +1 @@ +# Your code here From 13c50750b55ab75a5c280c6a85b7ad0fc93e85a0 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 08:56:17 +0100 Subject: [PATCH 07/65] Update solution.hide.py --- exercises/28-sequence-of-lines/solution.hide.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/exercises/28-sequence-of-lines/solution.hide.py b/exercises/28-sequence-of-lines/solution.hide.py index 839fa111..c22f8ee7 100644 --- a/exercises/28-sequence-of-lines/solution.hide.py +++ b/exercises/28-sequence-of-lines/solution.hide.py @@ -1,4 +1,5 @@ +# Your code here def lines(text): return text.upper() -print(lines('Hello world')) \ No newline at end of file +print(lines('Hello world, practice makes perfect')) From 65d5808f62b43305deadd851d5a87aabb2de6cc7 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 08:57:54 +0100 Subject: [PATCH 08/65] Update test.py --- exercises/28-sequence-of-lines/test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/28-sequence-of-lines/test.py b/exercises/28-sequence-of-lines/test.py index 25a9c103..d4eabc43 100644 --- a/exercises/28-sequence-of-lines/test.py +++ b/exercises/28-sequence-of-lines/test.py @@ -9,6 +9,6 @@ def test_function_existence(capsys, app): def test_expected_output(capsys, app): assert app.lines("hello world") == "HELLO WORLD" -@pytest.mark.it('The function should return the expected output') +@pytest.mark.it('The function should return the expected output. Testing with a different value') def test_another_output(capsys, app): assert app.lines("LeT the WOrld know YoU") == "LET THE WORLD KNOW YOU" From 26da2690a1fc3944f70af6f7e474fe43e94cffad Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 09:27:29 +0100 Subject: [PATCH 09/65] Update README.md --- exercises/29-remove-duplicate-words/README.md | 25 +++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/exercises/29-remove-duplicate-words/README.md b/exercises/29-remove-duplicate-words/README.md index 3909c46a..c8ac225e 100644 --- a/exercises/29-remove-duplicate-words/README.md +++ b/exercises/29-remove-duplicate-words/README.md @@ -1,12 +1,23 @@ # `29` Remove duplicate words -Write a program that accepts a sequence of whitespace separated words as input and prints the words after removing all duplicate words and sorting them alphanumerically. -Suppose the following input is supplied to the program: -hello world and practice makes perfect and hello world again -Then, the output should be: +## 📝 Instructions: + +1. Write a function called `remove_duplicate_words()` that accepts a sequence of whitespace separated words as input and prints the words after removing all duplicate words and sorting them alphanumerically. + +## 📎 Example input: + +```py +remove_duplicate_words("hello world and practice makes perfect and hello world again") +``` + +## 📎 Example output: + +```text again and hello makes perfect practice world +``` + +## 💡 Hints: -Hints: -In case of input data being supplied to the question, it should be assumed to be a console input. -We use set container to remove duplicated data automatically and then use sorted() to sort the data. ++ You can utilize a `set` to automatically eliminate duplicates. ++ You can use `sorted()` to sort the data from a list. From d6e0a4210b35368ab9aa674b483dd3968e19a08c Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 09:31:10 +0100 Subject: [PATCH 10/65] Update README.md --- exercises/29-remove-duplicate-words/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/29-remove-duplicate-words/README.md b/exercises/29-remove-duplicate-words/README.md index c8ac225e..ab1b4cfd 100644 --- a/exercises/29-remove-duplicate-words/README.md +++ b/exercises/29-remove-duplicate-words/README.md @@ -18,6 +18,6 @@ again and hello makes perfect practice world ## 💡 Hints: -+ You can utilize a `set` to automatically eliminate duplicates. ++ You can utilize the `set` data type to automatically eliminate duplicates. + You can use `sorted()` to sort the data from a list. From d0e5d1ac3143e402480ea59ffb6e234b8f0fc882 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 09:35:35 +0100 Subject: [PATCH 11/65] Update README.es.md --- .../29-remove-duplicate-words/README.es.md | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/exercises/29-remove-duplicate-words/README.es.md b/exercises/29-remove-duplicate-words/README.es.md index 2683b9a2..926eb2f0 100644 --- a/exercises/29-remove-duplicate-words/README.es.md +++ b/exercises/29-remove-duplicate-words/README.es.md @@ -1,18 +1,23 @@ -# `29`Eliminar los duplicados +# `29` Remove duplicate words -Escribe un programa que acepte una secuencia de palabras separadas por espacios en blanco como entrada y que imprima luego las palabras eliminando todas las duplicadas y ordenándolas alfanuméricamente. +## 📝 Instrucciones: -Supongamos que se le entrega la siguiente entrada al programa: +1. Escribe la función `remove_duplicate_words()` que tome una secuencia de palabras separadas por espacios en blanco como entrada. Luego, imprime las palabras eliminando duplicados y organizándolas alfanuméricamente. -hello world and practice makes perfect and hello world again +## 📎 Ejemplo de entrada: -El resultado debería ser: +```py +remove_duplicate_words("hello world and practice makes perfect and hello world again") +``` -again and hello makes perfect practice world +## 📎 Ejemplo de salida: -Pistas: -En caso de que se le entregue entradas de datos a la pregunta, debe asumirse como entrada de la consola. +```text +again and hello makes perfect practice world +``` -Usa set container para eliminar los datos duplicados automáticamente y luego usa sorted() para ordenar los datos. +## 💡 Pistas: ++ Puedes utilizar el tipo de dato `set` para eliminar automáticamente cualquier duplicado. ++ Puedes utilizar `sorted()` para ordenar los elementos de una lista. From 5ecc779fcce3c52ecff2487e2a445f9df97f4850 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 09:38:00 +0100 Subject: [PATCH 12/65] Update app.py --- exercises/29-remove-duplicate-words/app.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/exercises/29-remove-duplicate-words/app.py b/exercises/29-remove-duplicate-words/app.py index 4398984a..fce62c1d 100644 --- a/exercises/29-remove-duplicate-words/app.py +++ b/exercises/29-remove-duplicate-words/app.py @@ -1,3 +1 @@ -s = input() -words = [word for word in s.split(" ")] -print (" ".join(sorted(list(set(words))))) \ No newline at end of file +# Your code here From 9a7ce14997506706019c836d15b4885a58d9319a Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 09:38:54 +0100 Subject: [PATCH 13/65] Update solution.hide.py --- exercises/29-remove-duplicate-words/solution.hide.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/exercises/29-remove-duplicate-words/solution.hide.py b/exercises/29-remove-duplicate-words/solution.hide.py index 5bf7df2d..933ddac6 100644 --- a/exercises/29-remove-duplicate-words/solution.hide.py +++ b/exercises/29-remove-duplicate-words/solution.hide.py @@ -1,3 +1,6 @@ +# Your code here def remove_duplicate_words(text): words = text.split() return (" ".join(sorted(list(set(words))))) + +print(remove_duplicate_words("hello world and practice makes perfect and hello world again")) From 5d821e463037554e81cda38930c877a41d336ad7 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 09:40:11 +0100 Subject: [PATCH 14/65] Update test.py --- exercises/29-remove-duplicate-words/test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/29-remove-duplicate-words/test.py b/exercises/29-remove-duplicate-words/test.py index ea930f4d..a691e83e 100644 --- a/exercises/29-remove-duplicate-words/test.py +++ b/exercises/29-remove-duplicate-words/test.py @@ -8,11 +8,11 @@ def test_function_existence(capsys, app): def test_expected_output(capsys, app): assert app.remove_duplicate_words("hello world and practice makes perfect and hello world again") == "again and hello makes perfect practice world" -@pytest.mark.it('The function should work with other entries') +@pytest.mark.it('The function should work with other entries. Testing with different values') def test_expected_output_2(capsys, app): assert app.remove_duplicate_words("lets try this again with another try") == "again another lets this try with" -@pytest.mark.it('The function should work with other entries') +@pytest.mark.it('The function should work with other entries. Testing with different values') def test_expected_output_3(capsys, app): assert app.remove_duplicate_words("Jacke was Named Jacke by his mother") == "Jacke Named by his mother was" From 7b8e1b456ad37182e657e23eb70df226b0a533a8 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 09:48:55 +0100 Subject: [PATCH 15/65] Update README.md --- exercises/29-remove-duplicate-words/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/29-remove-duplicate-words/README.md b/exercises/29-remove-duplicate-words/README.md index ab1b4cfd..86541103 100644 --- a/exercises/29-remove-duplicate-words/README.md +++ b/exercises/29-remove-duplicate-words/README.md @@ -18,6 +18,6 @@ again and hello makes perfect practice world ## 💡 Hints: -+ You can utilize the `set` data type to automatically eliminate duplicates. ++ You can convert your input into the `set` data type to automatically eliminate duplicates. + You can use `sorted()` to sort the data from a list. From df0ab97adaaf3a49ae2fd41d4df39417c6e7bfc6 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 09:49:30 +0100 Subject: [PATCH 16/65] Update README.es.md --- exercises/29-remove-duplicate-words/README.es.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/29-remove-duplicate-words/README.es.md b/exercises/29-remove-duplicate-words/README.es.md index 926eb2f0..7e6f852a 100644 --- a/exercises/29-remove-duplicate-words/README.es.md +++ b/exercises/29-remove-duplicate-words/README.es.md @@ -18,6 +18,6 @@ again and hello makes perfect practice world ## 💡 Pistas: -+ Puedes utilizar el tipo de dato `set` para eliminar automáticamente cualquier duplicado. ++ Puedes convertir tu entrada en el tipo de dato `set` para eliminar automáticamente cualquier duplicado. + Puedes utilizar `sorted()` para ordenar los elementos de una lista. From f4b8bf4404f47251aa7039742152e51ec5fc5f0b Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 10:24:20 +0100 Subject: [PATCH 17/65] Update README.md --- exercises/30-divisable-binary/README.md | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/exercises/30-divisable-binary/README.md b/exercises/30-divisable-binary/README.md index 66c6463a..7b4bef71 100644 --- a/exercises/30-divisable-binary/README.md +++ b/exercises/30-divisable-binary/README.md @@ -1,9 +1,17 @@ -Write a program which accepts a sequence of comma separated 4 digit binary numbers as its input and then check whether they are divisible by 5 or not. The numbers that are divisible by 5 are to be printed in a comma separated sequence. -Example: -0100,0011,1010,1001 -Then the output should be: -1010 -Notes: Assume the data is input by console. +# `30` Divisable binary + +## 📝 Instructions: + +1. Write a function `divisible_binary()` that takes a sequence of comma-separated 4-digit binary numbers as input and checks if they are divisible by 5. Print the numbers that are divisible by 5 in a comma-separated sequence. + +## 📎 Example input: -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 +```py +divisible_binary(0100,0011,1010,1001) +``` + +## 📎 Example output: + +```py +1010 +``` From 138fbdb93bb861e7137622b008fb3df5aeb99994 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 10:30:24 +0100 Subject: [PATCH 18/65] Create README.es.md --- exercises/30-divisable-binary/README.es.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 exercises/30-divisable-binary/README.es.md diff --git a/exercises/30-divisable-binary/README.es.md b/exercises/30-divisable-binary/README.es.md new file mode 100644 index 00000000..0224ca35 --- /dev/null +++ b/exercises/30-divisable-binary/README.es.md @@ -0,0 +1,17 @@ +# `30` Divisable binary + +## 📝 Instrucciones: + +1. Escribe la función `divisible_binary()` que tome una secuencia de números binarios de 4 dígitos separados por comas como entrada y verifique si son divisibles por 5. Imprime los números que son divisibles por 5 en una secuencia separada por comas. + +## 📎 Ejemplo de entrada: + +```py +divisible_binary(0100,0011,1010,1001) +``` + +## 📎 Ejemplo de salida: + +```py +1010 +``` From dffdf0a0613f31c44641d5260328bf3ec816058c Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 10:44:03 +0100 Subject: [PATCH 19/65] Update app.py --- exercises/30-divisable-binary/app.py | 1 + 1 file changed, 1 insertion(+) diff --git a/exercises/30-divisable-binary/app.py b/exercises/30-divisable-binary/app.py index e69de29b..a51f0856 100644 --- a/exercises/30-divisable-binary/app.py +++ b/exercises/30-divisable-binary/app.py @@ -0,0 +1 @@ +# Your code here From ffd37e3348046d151d18ed60a0572f51f20ecbb1 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 10:47:42 +0100 Subject: [PATCH 20/65] Update solution.hide.py --- exercises/30-divisable-binary/solution.hide.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/exercises/30-divisable-binary/solution.hide.py b/exercises/30-divisable-binary/solution.hide.py index e0656be2..7a7e88c7 100644 --- a/exercises/30-divisable-binary/solution.hide.py +++ b/exercises/30-divisable-binary/solution.hide.py @@ -1,9 +1,10 @@ -def divisable_binary(text): - value=[] - items=[x for x in text.split(',')] - for p in items: - intp = int(p, 2) - if not intp%5: - value.append(p) +# Your code here +def divisible_binary(binary_sequence): + divisible_numbers = [] + binary_numbers = [x for x in binary_sequence.split(',')] + for binary_num in binary_numbers: + int_binary_num = int(binary_num, 2) + if not int_binary_num % 5: + divisible_numbers.append(binary_num) - return (','.join(value)) \ No newline at end of file + return ','.join(divisible_numbers) From acd5aa21c85d06f3909206cf3ee98e7bb1a1bc71 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 10:52:00 +0100 Subject: [PATCH 21/65] Update solution.hide.py --- exercises/30-divisable-binary/solution.hide.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/exercises/30-divisable-binary/solution.hide.py b/exercises/30-divisable-binary/solution.hide.py index 7a7e88c7..fe9cc7b5 100644 --- a/exercises/30-divisable-binary/solution.hide.py +++ b/exercises/30-divisable-binary/solution.hide.py @@ -8,3 +8,5 @@ def divisible_binary(binary_sequence): divisible_numbers.append(binary_num) return ','.join(divisible_numbers) + +print(divisible_binary("1000,1100,1010,1111")) From 2fcf548d8977b8f92029e7e6416e791341f42fcb Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 10:52:53 +0100 Subject: [PATCH 22/65] Update test.py --- exercises/30-divisable-binary/test.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/exercises/30-divisable-binary/test.py b/exercises/30-divisable-binary/test.py index 7c9bdc88..2a8a6168 100644 --- a/exercises/30-divisable-binary/test.py +++ b/exercises/30-divisable-binary/test.py @@ -1,17 +1,17 @@ import pytest, io, sys, json, mock, re, os -@pytest.mark.it('The function divisable_binary must exist') +@pytest.mark.it('The function divisible_binary must exist') def test_function_existence(capsys, app): - assert app.divisable_binary + assert app.divisible_binary @pytest.mark.it('The function should return the expected output') def test_expected_output(capsys, app): - assert app.divisable_binary("0100,0011,1010,1001") == "1010" + assert app.divisible_binary("0100,0011,1010,1001") == "1010" @pytest.mark.it('The function should work with other parameters. testing with 1111,1000,0101,0000') def test_expected_output_2(capsys, app): - assert app.divisable_binary("1111,1000,0101,0000") == "1111,0101,0000" + assert app.divisible_binary("1111,1000,0101,0000") == "1111,0101,0000" @pytest.mark.it("The function should work with other parameters. Testing with 1000") def test_expected_output_3(capsys, app): - assert app.divisable_binary("1000,1000,1000,1000") == "" \ No newline at end of file + assert app.divisible_binary("1000,1000,1000,1000") == "" From dd965a364a67485ab9c6eaebf3cb08a823884c27 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 10:57:02 +0100 Subject: [PATCH 23/65] Update app.py --- exercises/31-sum-eigth-digit/app.py | 1 + 1 file changed, 1 insertion(+) diff --git a/exercises/31-sum-eigth-digit/app.py b/exercises/31-sum-eigth-digit/app.py index e69de29b..a51f0856 100644 --- a/exercises/31-sum-eigth-digit/app.py +++ b/exercises/31-sum-eigth-digit/app.py @@ -0,0 +1 @@ +# Your code here From 6ce1552fc7717e278d0ef1b014b183f5f9bbfc37 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 11:16:03 +0100 Subject: [PATCH 24/65] Update README.md --- exercises/31-sum-eigth-digit/README.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/exercises/31-sum-eigth-digit/README.md b/exercises/31-sum-eigth-digit/README.md index c89832cb..6a4a10d3 100644 --- a/exercises/31-sum-eigth-digit/README.md +++ b/exercises/31-sum-eigth-digit/README.md @@ -1,7 +1,5 @@ -Write a program, which will find all such numbers between 1000 and 3000 (both included) such that each digit of the number is an even number. -The numbers obtained should be printed in a comma-separated sequence on a single line. +# `31` Sum eight digit -Hints: -In case of input data being supplied to the question, it should be assumed to be a console input. +## 📝 Instructions: -Solution: +1. Define a function named `sum_eight_digit()` to identify and print all numbers between 1000 and 3000 (inclusive) where each digit is an even number. Display the resulting numbers in a comma-separated sequence on a single line. From 3edd0a946d65b11ed8b002c08683b7e262561914 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 11:21:22 +0100 Subject: [PATCH 25/65] Create README.es.md --- exercises/31-sum-eigth-digit/README.es.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 exercises/31-sum-eigth-digit/README.es.md diff --git a/exercises/31-sum-eigth-digit/README.es.md b/exercises/31-sum-eigth-digit/README.es.md new file mode 100644 index 00000000..08a637c9 --- /dev/null +++ b/exercises/31-sum-eigth-digit/README.es.md @@ -0,0 +1,5 @@ +# `31` Sum eight digit + +## 📝 Instrucciones: + +1. Define una función llamada `sum_eight_digit()` para identificar e imprimir todos los números entre 1000 y 3000 (inclusive) en los que cada dígito es un número par. Muestra los números resultantes en una secuencia separada por comas en una sola línea. From a99592312e18fdc7c7599387654d2932fa63e5a6 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 11:21:47 +0100 Subject: [PATCH 26/65] Update solution.hide.py --- exercises/31-sum-eigth-digit/solution.hide.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/exercises/31-sum-eigth-digit/solution.hide.py b/exercises/31-sum-eigth-digit/solution.hide.py index 734e8f7e..1b875d24 100644 --- a/exercises/31-sum-eigth-digit/solution.hide.py +++ b/exercises/31-sum-eigth-digit/solution.hide.py @@ -1,6 +1,11 @@ -values = [] -for i in range(1000, 3001): - s = str(i) - if (int(s[0])%2==0) and (int(s[1])%2==0) and (int(s[2])%2==0) and (int(s[3])%2==0): - values.append(s) -print ",".join(values) \ No newline at end of file +# Your code here +def sum_eight_digit(): + values = [] + for i in range(1000, 3001): + s = str(i) + if (int(s[0]) % 2 == 0) and (int(s[1]) % 2 == 0) and (int(s[2]) % 2 == 0) and (int(s[3]) % 2 == 0): + values.append(s) + + return ",".join(values) + +print(sum_eight_digit()) From e884a4a0fec79e6c224450dab3837af748c39cf2 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 11:45:10 +0100 Subject: [PATCH 27/65] Update README.md --- .../README.md | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/exercises/32-numbers-of-letters-and-digits/README.md b/exercises/32-numbers-of-letters-and-digits/README.md index eb930888..d602fded 100644 --- a/exercises/32-numbers-of-letters-and-digits/README.md +++ b/exercises/32-numbers-of-letters-and-digits/README.md @@ -1,9 +1,18 @@ -Write a program that accepts a sentence and calculate the number of letters and digits. -Suppose the following input is supplied to the program: -hello world! 123 -Then, the output should be: +# `30` Number of letters and digits + +## 📝 Instructions: + +1. Write a function named `letters_and_digits()` that takes a sentence as input and calculates the number of letters and digits present in it. + +## 📎 Example input: + +```py +letters_and_digits(hello world! 123) +``` + +## 📎 Example output: + +```text LETTERS 10 DIGITS 3 - -Hints: -In case of input data being supplied to the question, it should be assumed to be a console input. +``` From 77aa06b75a0bc8545dca0d1c3c5208b0f22c6c0a Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 11:45:26 +0100 Subject: [PATCH 28/65] Update README.md --- exercises/32-numbers-of-letters-and-digits/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/32-numbers-of-letters-and-digits/README.md b/exercises/32-numbers-of-letters-and-digits/README.md index d602fded..15ad5ec0 100644 --- a/exercises/32-numbers-of-letters-and-digits/README.md +++ b/exercises/32-numbers-of-letters-and-digits/README.md @@ -7,7 +7,7 @@ ## 📎 Example input: ```py -letters_and_digits(hello world! 123) +letters_and_digits("hello world! 123") ``` ## 📎 Example output: From bf712bb900032d2824a7449f4cf7068a093d88e8 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 11:51:26 +0100 Subject: [PATCH 29/65] Create README.es.md --- .../README.es.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 exercises/32-numbers-of-letters-and-digits/README.es.md diff --git a/exercises/32-numbers-of-letters-and-digits/README.es.md b/exercises/32-numbers-of-letters-and-digits/README.es.md new file mode 100644 index 00000000..3730ae8c --- /dev/null +++ b/exercises/32-numbers-of-letters-and-digits/README.es.md @@ -0,0 +1,18 @@ +# `30` Number of letters and digits + +## 📝 Instrucciones: + +1. Escribe una función llamada `letters_and_digits()` que tome una oración como entrada y calcule la cantidad de letras y dígitos presentes en ella. + +## 📎 Ejemplo de entrada: + +```py +letters_and_digits(hello world! 123) +``` + +## 📎 Ejemplo de salida: + +```text +LETTERS 10 +DIGITS 3 +``` From 7012811d4ac2eaf5851b727db73ce9be5c54cc2a Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 11:51:38 +0100 Subject: [PATCH 30/65] Update app.py --- exercises/32-numbers-of-letters-and-digits/app.py | 1 + 1 file changed, 1 insertion(+) diff --git a/exercises/32-numbers-of-letters-and-digits/app.py b/exercises/32-numbers-of-letters-and-digits/app.py index e69de29b..a51f0856 100644 --- a/exercises/32-numbers-of-letters-and-digits/app.py +++ b/exercises/32-numbers-of-letters-and-digits/app.py @@ -0,0 +1 @@ +# Your code here From fb8ae1d6a6ddaa7d699948b7962ec91af4148e8f Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 11:55:34 +0100 Subject: [PATCH 31/65] Update solution.hide.py --- .../solution.hide.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/exercises/32-numbers-of-letters-and-digits/solution.hide.py b/exercises/32-numbers-of-letters-and-digits/solution.hide.py index 0c3044a4..ae357833 100644 --- a/exercises/32-numbers-of-letters-and-digits/solution.hide.py +++ b/exercises/32-numbers-of-letters-and-digits/solution.hide.py @@ -1,11 +1,12 @@ +# Your code here def letters_and_digits(text): - d={"DIGITS":0, "LETTERS":0} - for c in text: - if c.isdigit(): - d["DIGITS"]+=1 - elif c.isalpha(): - d["LETTERS"]+=1 + counts = {"DIGITS": 0, "LETTERS": 0} + for char in text: + if char.isdigit(): + counts["DIGITS"] += 1 + elif char.isalpha(): + counts["LETTERS"] += 1 else: pass - return ("LETTERS {} DIGITS {}".format(d['LETTERS'], d['DIGITS'])) \ No newline at end of file + return f"LETTERS {counts['LETTERS']} DIGITS {counts['DIGITS']}" From 15acd9a1322880474edcfb85b2aae77b62c5cc26 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 11:57:02 +0100 Subject: [PATCH 32/65] Update test.py --- exercises/32-numbers-of-letters-and-digits/test.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/exercises/32-numbers-of-letters-and-digits/test.py b/exercises/32-numbers-of-letters-and-digits/test.py index f941727f..72c906df 100644 --- a/exercises/32-numbers-of-letters-and-digits/test.py +++ b/exercises/32-numbers-of-letters-and-digits/test.py @@ -5,11 +5,10 @@ def test_function_existence(capsys, app): assert app.letters_and_digits - @pytest.mark.it('The function should return the expected output') def test_output(capsys, app): app.letters_and_digits("hello world! 123") == "LETTERS 10 DIGITS 3" @pytest.mark.it('The solution should work with other parameters') def test_another_entry(capsys, app): - assert app.letters_and_digits("My name is C200 and i live in apartment 3H") == "LETTERS 29 DIGITS 4" \ No newline at end of file + assert app.letters_and_digits("My name is C200 and i live in apartment 3H") == "LETTERS 29 DIGITS 4" From d8e1d6e5670f2643207411f776e912eb50d31065 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 11:57:13 +0100 Subject: [PATCH 33/65] Update solution.hide.py --- exercises/32-numbers-of-letters-and-digits/solution.hide.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/exercises/32-numbers-of-letters-and-digits/solution.hide.py b/exercises/32-numbers-of-letters-and-digits/solution.hide.py index ae357833..7724e8eb 100644 --- a/exercises/32-numbers-of-letters-and-digits/solution.hide.py +++ b/exercises/32-numbers-of-letters-and-digits/solution.hide.py @@ -10,3 +10,5 @@ def letters_and_digits(text): pass return f"LETTERS {counts['LETTERS']} DIGITS {counts['DIGITS']}" + +print(letters_and_digits("hello world! 123")) From 550fb6bd1eeb75c1ea0c42ebe98a109abe22d37c Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 12:01:52 +0100 Subject: [PATCH 34/65] Update README.md --- exercises/32-numbers-of-letters-and-digits/README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/exercises/32-numbers-of-letters-and-digits/README.md b/exercises/32-numbers-of-letters-and-digits/README.md index 15ad5ec0..6215e53d 100644 --- a/exercises/32-numbers-of-letters-and-digits/README.md +++ b/exercises/32-numbers-of-letters-and-digits/README.md @@ -16,3 +16,7 @@ letters_and_digits("hello world! 123") LETTERS 10 DIGITS 3 ``` + +## 💡 Hint: + ++ Define a dictionary for storing both counts in one variable. From 9a405ef7a1ed7f871f969b7e09725df45f3ebba1 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 12:03:07 +0100 Subject: [PATCH 35/65] Update README.es.md --- exercises/32-numbers-of-letters-and-digits/README.es.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/exercises/32-numbers-of-letters-and-digits/README.es.md b/exercises/32-numbers-of-letters-and-digits/README.es.md index 3730ae8c..525090f1 100644 --- a/exercises/32-numbers-of-letters-and-digits/README.es.md +++ b/exercises/32-numbers-of-letters-and-digits/README.es.md @@ -16,3 +16,7 @@ letters_and_digits(hello world! 123) LETTERS 10 DIGITS 3 ``` + +## 💡 Pista: + ++ Define un diccionario para guardar ambas cuentas en una sola variable. From 2ae56424dbef862132f248616a66ec9dfccd1b36 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 12:03:22 +0100 Subject: [PATCH 36/65] Update README.md --- exercises/32-numbers-of-letters-and-digits/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/32-numbers-of-letters-and-digits/README.md b/exercises/32-numbers-of-letters-and-digits/README.md index 6215e53d..67f622f2 100644 --- a/exercises/32-numbers-of-letters-and-digits/README.md +++ b/exercises/32-numbers-of-letters-and-digits/README.md @@ -19,4 +19,4 @@ DIGITS 3 ## 💡 Hint: -+ Define a dictionary for storing both counts in one variable. ++ Declare a dictionary for storing both counts in one variable. From 3dda56bb5b01005a2c953a467565300cb6afc917 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 12:03:39 +0100 Subject: [PATCH 37/65] Update README.es.md --- exercises/32-numbers-of-letters-and-digits/README.es.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/32-numbers-of-letters-and-digits/README.es.md b/exercises/32-numbers-of-letters-and-digits/README.es.md index 525090f1..f7783e5a 100644 --- a/exercises/32-numbers-of-letters-and-digits/README.es.md +++ b/exercises/32-numbers-of-letters-and-digits/README.es.md @@ -19,4 +19,4 @@ DIGITS 3 ## 💡 Pista: -+ Define un diccionario para guardar ambas cuentas en una sola variable. ++ Declara un diccionario para guardar ambas cuentas en una sola variable. From d800b6d2b68cac1b5ecd15b3b07fa59bb4b4da8e Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 12:10:41 +0100 Subject: [PATCH 38/65] Update README.md --- exercises/33-number-of-uppercase/README.md | 31 +++++++++++++++------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/exercises/33-number-of-uppercase/README.md b/exercises/33-number-of-uppercase/README.md index 53248315..ab4e4c81 100644 --- a/exercises/33-number-of-uppercase/README.md +++ b/exercises/33-number-of-uppercase/README.md @@ -1,9 +1,22 @@ -Write a program that accepts a sentence and calculate the number of upper case letters and lower case letters. -Suppose the following input is supplied to the program: -Hello world! -Then, the output should be: -UPPER CASE 1 -LOWER CASE 9 - -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 +# `30` Number of uppercase + +## 📝 Instructions: + +1. Write a program `number_of_uppercase()` that accepts a sentence and calculates the number of uppercase and lowercase letters. + +## 📎 Example input: + +```py +number_of_uppercase("Hello world!") +``` + +## 📎 Example output: + +```text +UPPERCASE 1 +LOWERCASE 9 +``` + +## 💡 Hint: + ++ Declare a dictionary for storing both counts in one variable. From 5cd158c415c88dfc9dfe8e9d82706e46cda76ede Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 12:11:01 +0100 Subject: [PATCH 39/65] Update app.py --- exercises/33-number-of-uppercase/app.py | 1 + 1 file changed, 1 insertion(+) diff --git a/exercises/33-number-of-uppercase/app.py b/exercises/33-number-of-uppercase/app.py index e69de29b..a51f0856 100644 --- a/exercises/33-number-of-uppercase/app.py +++ b/exercises/33-number-of-uppercase/app.py @@ -0,0 +1 @@ +# Your code here From 250508fc905579e3a9d064ea734aa8ebb411f9f1 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 12:13:03 +0100 Subject: [PATCH 40/65] Create README.es.md --- exercises/33-number-of-uppercase/README.es.md | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 exercises/33-number-of-uppercase/README.es.md diff --git a/exercises/33-number-of-uppercase/README.es.md b/exercises/33-number-of-uppercase/README.es.md new file mode 100644 index 00000000..6072f8ce --- /dev/null +++ b/exercises/33-number-of-uppercase/README.es.md @@ -0,0 +1,22 @@ +# `30` Number of uppercase + +## 📝 Instrucciones: + +1. Escribe una función llamada `number_of_uppercase()` que acepte una frase y calcule la cantidad de letras en mayúsculas (uppercase) y minúsculas (lowercase). + +## 📎 Ejemplo de entrada: + +```py +number_of_uppercase("Hello world!") +``` + +## 📎 Ejemplo de salida: + +```text +UPPERCASE 1 +LOWERCASE 9 +``` + +## 💡 Pista: + ++ Declara un diccionario para guardar ambas cuentas en una sola variable. From 6fa0295a0065c722b3d59e2f7d64faee2a17aca6 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 12:25:12 +0100 Subject: [PATCH 41/65] Update solution.hide.py --- .../33-number-of-uppercase/solution.hide.py | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/exercises/33-number-of-uppercase/solution.hide.py b/exercises/33-number-of-uppercase/solution.hide.py index 089740b7..c1cdc7b3 100644 --- a/exercises/33-number-of-uppercase/solution.hide.py +++ b/exercises/33-number-of-uppercase/solution.hide.py @@ -1,11 +1,14 @@ -s = raw_input() -d={"UPPER CASE":0, "LOWER CASE":0} -for c in s: - if c.isupper(): - d["UPPER CASE"]+=1 - elif c.islower(): - d["LOWER CASE"]+=1 - else: - pass -print "UPPER CASE", d["UPPER CASE"] -print "LOWER CASE", d["LOWER CASE"] \ No newline at end of file +# Your code here +def number_of_uppercase(string): + counts = {"UPPERCASE": 0, "LOWERCASE": 0} + for char in string: + if char.isupper(): + counts["UPPERCASE"] += 1 + elif char.islower(): + counts["LOWERCASE"] += 1 + else: + pass + + return f"UPPERCASE {counts['UPPERCASE']} LOWERCASE {counts['LOWERCASE']}" + +print(number_of_uppercase("Hello world!")) From 12ee33e46e59391bcbbe1f7aaa8b8a2b797d5add Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 12:26:43 +0100 Subject: [PATCH 42/65] Update README.md --- exercises/32-numbers-of-letters-and-digits/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/32-numbers-of-letters-and-digits/README.md b/exercises/32-numbers-of-letters-and-digits/README.md index 67f622f2..8e0be7da 100644 --- a/exercises/32-numbers-of-letters-and-digits/README.md +++ b/exercises/32-numbers-of-letters-and-digits/README.md @@ -1,4 +1,4 @@ -# `30` Number of letters and digits +# `32` Number of letters and digits ## 📝 Instructions: From 7b9096b912f811765bd5e2516bd6514931f1d7db Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 12:26:50 +0100 Subject: [PATCH 43/65] Update README.es.md --- exercises/32-numbers-of-letters-and-digits/README.es.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/32-numbers-of-letters-and-digits/README.es.md b/exercises/32-numbers-of-letters-and-digits/README.es.md index f7783e5a..3f151c76 100644 --- a/exercises/32-numbers-of-letters-and-digits/README.es.md +++ b/exercises/32-numbers-of-letters-and-digits/README.es.md @@ -1,4 +1,4 @@ -# `30` Number of letters and digits +# `32` Number of letters and digits ## 📝 Instrucciones: From f975360bf800798c39e9a27f4c1832b7c3b25074 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 12:27:30 +0100 Subject: [PATCH 44/65] Update README.md --- exercises/33-number-of-uppercase/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/33-number-of-uppercase/README.md b/exercises/33-number-of-uppercase/README.md index ab4e4c81..07897d2c 100644 --- a/exercises/33-number-of-uppercase/README.md +++ b/exercises/33-number-of-uppercase/README.md @@ -1,4 +1,4 @@ -# `30` Number of uppercase +# `33` Number of uppercase ## 📝 Instructions: From 796164d6a7095484dbac78167edfdcd7ef76d99e Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 12:27:36 +0100 Subject: [PATCH 45/65] Update README.es.md --- exercises/33-number-of-uppercase/README.es.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/33-number-of-uppercase/README.es.md b/exercises/33-number-of-uppercase/README.es.md index 6072f8ce..c2e37f9b 100644 --- a/exercises/33-number-of-uppercase/README.es.md +++ b/exercises/33-number-of-uppercase/README.es.md @@ -1,4 +1,4 @@ -# `30` Number of uppercase +# `33` Number of uppercase ## 📝 Instrucciones: From 6dd5ebf09ce94d33553a23cf68b0c15b3e710c16 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 12:34:26 +0100 Subject: [PATCH 46/65] Update README.md --- exercises/34-a_aa_aaa_aaaa/README.md | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/exercises/34-a_aa_aaa_aaaa/README.md b/exercises/34-a_aa_aaa_aaaa/README.md index 8358c540..a1bafb07 100644 --- a/exercises/34-a_aa_aaa_aaaa/README.md +++ b/exercises/34-a_aa_aaa_aaaa/README.md @@ -1,8 +1,18 @@ -Write a program that computes the value of a+aa+aaa+aaaa with a given digit as the value of a. -Suppose the following input is supplied to the program: -9 -Then, the output should be: -11106 +# `34` a aa aaa aaaa + +## 📝 Instructions: + +1. Write a program `compute_the_value` that a sentence and calculates the number of uppercase and lowercase letters. +1. Write a program `compute_the_value` to calculate the sum of a+aa+aaa+aaaa, where 'a' is a given digit. + +## 📎 Example input: -Hints: -In case of input data being supplied to the question, it should be assumed to be a console input. +```py +compute_the_value("9") +``` + +## 📎 Example output: + +```py +11106 +``` From b7c0e9210b617f75b31dc342cf8d467f4be7bf45 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 12:34:37 +0100 Subject: [PATCH 47/65] Update README.md --- exercises/34-a_aa_aaa_aaaa/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/exercises/34-a_aa_aaa_aaaa/README.md b/exercises/34-a_aa_aaa_aaaa/README.md index a1bafb07..29865354 100644 --- a/exercises/34-a_aa_aaa_aaaa/README.md +++ b/exercises/34-a_aa_aaa_aaaa/README.md @@ -2,7 +2,6 @@ ## 📝 Instructions: -1. Write a program `compute_the_value` that a sentence and calculates the number of uppercase and lowercase letters. 1. Write a program `compute_the_value` to calculate the sum of a+aa+aaa+aaaa, where 'a' is a given digit. ## 📎 Example input: From a5c2f0b0fd198f4c326a3547e38983b738d4e460 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 12:35:00 +0100 Subject: [PATCH 48/65] Update README.md --- exercises/34-a_aa_aaa_aaaa/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/34-a_aa_aaa_aaaa/README.md b/exercises/34-a_aa_aaa_aaaa/README.md index 29865354..c826be9e 100644 --- a/exercises/34-a_aa_aaa_aaaa/README.md +++ b/exercises/34-a_aa_aaa_aaaa/README.md @@ -7,7 +7,7 @@ ## 📎 Example input: ```py -compute_the_value("9") +compute_the_value(9) ``` ## 📎 Example output: From 0dbb207faf72af0f4a82b297e8a3a8754088afbf Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 12:35:47 +0100 Subject: [PATCH 49/65] Update app.py --- exercises/34-a_aa_aaa_aaaa/app.py | 1 + 1 file changed, 1 insertion(+) diff --git a/exercises/34-a_aa_aaa_aaaa/app.py b/exercises/34-a_aa_aaa_aaaa/app.py index e69de29b..a51f0856 100644 --- a/exercises/34-a_aa_aaa_aaaa/app.py +++ b/exercises/34-a_aa_aaa_aaaa/app.py @@ -0,0 +1 @@ +# Your code here From 90aad78b5a79cd0903b7df1e7e27f48e4896094f Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 12:36:31 +0100 Subject: [PATCH 50/65] Update README.md --- exercises/34-a_aa_aaa_aaaa/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/34-a_aa_aaa_aaaa/README.md b/exercises/34-a_aa_aaa_aaaa/README.md index c826be9e..7abe5307 100644 --- a/exercises/34-a_aa_aaa_aaaa/README.md +++ b/exercises/34-a_aa_aaa_aaaa/README.md @@ -2,7 +2,7 @@ ## 📝 Instructions: -1. Write a program `compute_the_value` to calculate the sum of a+aa+aaa+aaaa, where 'a' is a given digit. +1. Write a program `computed_value` to calculate the sum of a+aa+aaa+aaaa, where 'a' is a given digit. ## 📎 Example input: From acc046a86c40724ee572b6de5b2d749bbcce7a1d Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 12:36:44 +0100 Subject: [PATCH 51/65] Update README.md --- exercises/34-a_aa_aaa_aaaa/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/34-a_aa_aaa_aaaa/README.md b/exercises/34-a_aa_aaa_aaaa/README.md index 7abe5307..c2097e98 100644 --- a/exercises/34-a_aa_aaa_aaaa/README.md +++ b/exercises/34-a_aa_aaa_aaaa/README.md @@ -2,12 +2,12 @@ ## 📝 Instructions: -1. Write a program `computed_value` to calculate the sum of a+aa+aaa+aaaa, where 'a' is a given digit. +1. Write a program `computed_value()` to calculate the sum of a+aa+aaa+aaaa, where 'a' is a given digit. ## 📎 Example input: ```py -compute_the_value(9) +computed_value(9) ``` ## 📎 Example output: From 94bd26dab3fa6315b0dcdef96537fd817bdef38f Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 12:39:52 +0100 Subject: [PATCH 52/65] Create README.es.md --- exercises/34-a_aa_aaa_aaaa/README.es.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 exercises/34-a_aa_aaa_aaaa/README.es.md diff --git a/exercises/34-a_aa_aaa_aaaa/README.es.md b/exercises/34-a_aa_aaa_aaaa/README.es.md new file mode 100644 index 00000000..f09ae6d9 --- /dev/null +++ b/exercises/34-a_aa_aaa_aaaa/README.es.md @@ -0,0 +1,17 @@ +# `34` a aa aaa aaaa + +## 📝 Instrucciones: + +1. Escribe un programa llamado `computed_value()` para calcular la suma de a+aa+aaa+aaaa, donde 'a' es un dígito dado. + +## 📎 Ejemplo de entrada: + +```py +computed_value(9) +``` + +## 📎 Ejemplo de salida: + +```py +11106 +``` From 8e73ab03fc656c1c6290852ed5fc58c2a368cc8e Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 12:41:42 +0100 Subject: [PATCH 53/65] Update solution.hide.py --- exercises/34-a_aa_aaa_aaaa/solution.hide.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/exercises/34-a_aa_aaa_aaaa/solution.hide.py b/exercises/34-a_aa_aaa_aaaa/solution.hide.py index 9db3c7d2..eac5ba27 100644 --- a/exercises/34-a_aa_aaa_aaaa/solution.hide.py +++ b/exercises/34-a_aa_aaa_aaaa/solution.hide.py @@ -1,6 +1,9 @@ +# Your code here def computed_value(param): n1 = int( "%s" % param ) n2 = int( "%s%s" % (param,param) ) n3 = int( "%s%s%s" % (param,param,param) ) n4 = int( "%s%s%s%s" % (param,param,param,param) ) - return (n1+n2+n3+n4) \ No newline at end of file + return (n1+n2+n3+n4) + +print(computed_value(9)) From dcd7b7611c468c19d252727b997aa4c875882775 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 12:43:42 +0100 Subject: [PATCH 54/65] Update test.py --- exercises/34-a_aa_aaa_aaaa/test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/34-a_aa_aaa_aaaa/test.py b/exercises/34-a_aa_aaa_aaaa/test.py index 0df320d5..c429325a 100644 --- a/exercises/34-a_aa_aaa_aaaa/test.py +++ b/exercises/34-a_aa_aaa_aaaa/test.py @@ -8,10 +8,10 @@ def test_function_existence(capsys, app): def test_expected_output(capsys, app): assert app.computed_value(9) == 11106 -@pytest.mark.it('The function should work with other enties. Testing with 123') +@pytest.mark.it('The function should work with other inputs. Testing with 123') def test_another_output(capsys, app): assert app.computed_value(123) == 123246369492 -@pytest.mark.it('The function should work with other enties. Testing with 0') +@pytest.mark.it('The function should work with other inputs. Testing with 0') def test_with_zero(capsys, app): assert app.computed_value(0) == 0 From 796f82bf0305190d35ecb21d25f3ccb742f84c14 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 19:28:45 +0100 Subject: [PATCH 55/65] Update README.md --- exercises/29-remove-duplicate-words/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/29-remove-duplicate-words/README.md b/exercises/29-remove-duplicate-words/README.md index 86541103..3d5469cb 100644 --- a/exercises/29-remove-duplicate-words/README.md +++ b/exercises/29-remove-duplicate-words/README.md @@ -2,7 +2,7 @@ ## 📝 Instructions: -1. Write a function called `remove_duplicate_words()` that accepts a sequence of whitespace separated words as input and prints the words after removing all duplicate words and sorting them alphanumerically. +1. Write a function called `remove_duplicate_words()` that accepts a sequence of whitespace separated words as input and returns the words after removing all duplicate words and sorting them alphanumerically. ## 📎 Example input: From a808b91212ae7522226cdee5511c3ab30eede139 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 19:29:37 +0100 Subject: [PATCH 56/65] Update README.es.md --- exercises/29-remove-duplicate-words/README.es.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/29-remove-duplicate-words/README.es.md b/exercises/29-remove-duplicate-words/README.es.md index 7e6f852a..10b56ac6 100644 --- a/exercises/29-remove-duplicate-words/README.es.md +++ b/exercises/29-remove-duplicate-words/README.es.md @@ -2,7 +2,7 @@ ## 📝 Instrucciones: -1. Escribe la función `remove_duplicate_words()` que tome una secuencia de palabras separadas por espacios en blanco como entrada. Luego, imprime las palabras eliminando duplicados y organizándolas alfanuméricamente. +1. Escribe la función `remove_duplicate_words()` que tome una secuencia de palabras separadas por espacios en blanco como entrada. Luego, retorna las palabras eliminando duplicados y organizándolas alfanuméricamente. ## 📎 Ejemplo de entrada: From 31dd90641f69806e2a2022ba706ae9e445b292e8 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 19:49:30 +0100 Subject: [PATCH 57/65] Update README.md --- exercises/30-divisable-binary/README.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/exercises/30-divisable-binary/README.md b/exercises/30-divisable-binary/README.md index 7b4bef71..6a0c6d58 100644 --- a/exercises/30-divisable-binary/README.md +++ b/exercises/30-divisable-binary/README.md @@ -7,7 +7,7 @@ ## 📎 Example input: ```py -divisible_binary(0100,0011,1010,1001) +divisible_binary("0100,0011,1010,1001") ``` ## 📎 Example output: @@ -15,3 +15,13 @@ divisible_binary(0100,0011,1010,1001) ```py 1010 ``` + +## 💡 Hint: + ++ To convert binary numbers into our everyday integer numbers (base 10 or decimal), you have to include the base of the number we input in the first argument (in this case, base 2 or binary), and the function `int()` will take care of the rest. Like this: + +```py +binary = 0101 +integer = int(binary, 2) +print(integer) # Output: 5 +``` From 655efe1dddd7eee9278bfa7306c4639ce0fdd1a5 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 19:51:31 +0100 Subject: [PATCH 58/65] Update README.es.md --- exercises/30-divisable-binary/README.es.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/exercises/30-divisable-binary/README.es.md b/exercises/30-divisable-binary/README.es.md index 0224ca35..4920cd2c 100644 --- a/exercises/30-divisable-binary/README.es.md +++ b/exercises/30-divisable-binary/README.es.md @@ -7,7 +7,7 @@ ## 📎 Ejemplo de entrada: ```py -divisible_binary(0100,0011,1010,1001) +divisible_binary("0100,0011,1010,1001") ``` ## 📎 Ejemplo de salida: @@ -15,3 +15,14 @@ divisible_binary(0100,0011,1010,1001) ```py 1010 ``` + +## 💡 Pista: + ++ Para convertir números binarios en nuestros números enteros cotidianos (base 10 o decimal), es necesario incluir la base del número que ingresamos en el primer argumento (en este caso, base 2 o binario), y la función `int()` se encargará del resto. Sería así: + +```py +binary = 0101 +decimal = int(binary, 2) + +print(decimal) # Output: 5 +``` From f3097b4ae194bbdfd917afb6e5171b56f7e80b84 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 19:53:05 +0100 Subject: [PATCH 59/65] Update README.md --- exercises/30-divisable-binary/README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/exercises/30-divisable-binary/README.md b/exercises/30-divisable-binary/README.md index 6a0c6d58..d8a4cc2d 100644 --- a/exercises/30-divisable-binary/README.md +++ b/exercises/30-divisable-binary/README.md @@ -21,7 +21,8 @@ divisible_binary("0100,0011,1010,1001") + To convert binary numbers into our everyday integer numbers (base 10 or decimal), you have to include the base of the number we input in the first argument (in this case, base 2 or binary), and the function `int()` will take care of the rest. Like this: ```py -binary = 0101 -integer = int(binary, 2) -print(integer) # Output: 5 +binary = '0101' +decimal = int(binary, 2) + +print(decimal) # Output: 5 ``` From 7c3178a8961fa5cc767a673d2f4f01e5ff43bbf2 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 19:53:18 +0100 Subject: [PATCH 60/65] Update README.es.md --- exercises/30-divisable-binary/README.es.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/30-divisable-binary/README.es.md b/exercises/30-divisable-binary/README.es.md index 4920cd2c..38dfe893 100644 --- a/exercises/30-divisable-binary/README.es.md +++ b/exercises/30-divisable-binary/README.es.md @@ -21,7 +21,7 @@ divisible_binary("0100,0011,1010,1001") + Para convertir números binarios en nuestros números enteros cotidianos (base 10 o decimal), es necesario incluir la base del número que ingresamos en el primer argumento (en este caso, base 2 o binario), y la función `int()` se encargará del resto. Sería así: ```py -binary = 0101 +binary = '0101' decimal = int(binary, 2) print(decimal) # Output: 5 From a7ecfcba76d5cbbe51b5044fc077dfab2893a282 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 19:58:26 +0100 Subject: [PATCH 61/65] Update README.md --- exercises/31-sum-eigth-digit/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/31-sum-eigth-digit/README.md b/exercises/31-sum-eigth-digit/README.md index 6a4a10d3..960031c4 100644 --- a/exercises/31-sum-eigth-digit/README.md +++ b/exercises/31-sum-eigth-digit/README.md @@ -1,5 +1,5 @@ -# `31` Sum eight digit +# `31` All digits even ## 📝 Instructions: -1. Define a function named `sum_eight_digit()` to identify and print all numbers between 1000 and 3000 (inclusive) where each digit is an even number. Display the resulting numbers in a comma-separated sequence on a single line. +1. Define a function named `all_digits_even()` to identify and print all numbers between 1000 and 3000 (inclusive) where each digit is an even number. Display the resulting numbers in a comma-separated sequence on a single line. From 232ebfe591075d400b4e6c5c2e8e7cb0a5d9a748 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 19:59:30 +0100 Subject: [PATCH 62/65] Update README.es.md --- exercises/31-sum-eigth-digit/README.es.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/31-sum-eigth-digit/README.es.md b/exercises/31-sum-eigth-digit/README.es.md index 08a637c9..0b35640d 100644 --- a/exercises/31-sum-eigth-digit/README.es.md +++ b/exercises/31-sum-eigth-digit/README.es.md @@ -1,5 +1,5 @@ -# `31` Sum eight digit +# `31` All digits even ## 📝 Instrucciones: -1. Define una función llamada `sum_eight_digit()` para identificar e imprimir todos los números entre 1000 y 3000 (inclusive) en los que cada dígito es un número par. Muestra los números resultantes en una secuencia separada por comas en una sola línea. +1. Define una función llamada `all_digits_even()` para identificar e imprimir todos los números entre 1000 y 3000 (inclusive) en los que cada dígito es un número par. Muestra los números resultantes en una secuencia separada por comas en una sola línea. From 00f6e17d44b464dd17eee2d20f33575076a3cbcb Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 20:00:08 +0100 Subject: [PATCH 63/65] Update solution.hide.py --- exercises/31-sum-eigth-digit/solution.hide.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/31-sum-eigth-digit/solution.hide.py b/exercises/31-sum-eigth-digit/solution.hide.py index 1b875d24..5a1fa67b 100644 --- a/exercises/31-sum-eigth-digit/solution.hide.py +++ b/exercises/31-sum-eigth-digit/solution.hide.py @@ -1,5 +1,5 @@ # Your code here -def sum_eight_digit(): +def all_digits_even(): values = [] for i in range(1000, 3001): s = str(i) @@ -8,4 +8,4 @@ def sum_eight_digit(): return ",".join(values) -print(sum_eight_digit()) +print(all_digits_even()) From 2275edfa2b82636d3866a37d3de32528c0ccc400 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 20:19:16 +0100 Subject: [PATCH 64/65] Update README.es.md --- exercises/32-numbers-of-letters-and-digits/README.es.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/32-numbers-of-letters-and-digits/README.es.md b/exercises/32-numbers-of-letters-and-digits/README.es.md index 3f151c76..b5dd7d4e 100644 --- a/exercises/32-numbers-of-letters-and-digits/README.es.md +++ b/exercises/32-numbers-of-letters-and-digits/README.es.md @@ -7,7 +7,7 @@ ## 📎 Ejemplo de entrada: ```py -letters_and_digits(hello world! 123) +letters_and_digits("hello world! 123") ``` ## 📎 Ejemplo de salida: From 7bc11bfa3b29a1133782d7f4d2cd729214d6f62b Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 20 Dec 2023 20:28:33 +0100 Subject: [PATCH 65/65] Update solution.hide.py --- exercises/34-a_aa_aaa_aaaa/solution.hide.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/exercises/34-a_aa_aaa_aaaa/solution.hide.py b/exercises/34-a_aa_aaa_aaaa/solution.hide.py index eac5ba27..4ae7207c 100644 --- a/exercises/34-a_aa_aaa_aaaa/solution.hide.py +++ b/exercises/34-a_aa_aaa_aaaa/solution.hide.py @@ -1,9 +1,9 @@ # Your code here def computed_value(param): - n1 = int( "%s" % param ) - n2 = int( "%s%s" % (param,param) ) - n3 = int( "%s%s%s" % (param,param,param) ) - n4 = int( "%s%s%s%s" % (param,param,param,param) ) - return (n1+n2+n3+n4) + result = 0 + for i in range(1, 5): + concatenated_number = int(str(param) * i) + result += concatenated_number + return result print(computed_value(9))