From 2f3eb64a1300bee7b1d4a20bd84c9258bdd4f5f9 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 16:26:40 +0100 Subject: [PATCH 01/59] Update app.py --- exercises/001-hello_world/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/001-hello_world/app.py b/exercises/001-hello_world/app.py index 801de24b..fce62c1d 100644 --- a/exercises/001-hello_world/app.py +++ b/exercises/001-hello_world/app.py @@ -1 +1 @@ -# your code here \ No newline at end of file +# Your code here From bece1012ed3f7c315722b67214a04e6715760ea4 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 16:29:06 +0100 Subject: [PATCH 02/59] Create solution.hide.py --- exercises/001-hello_world/solution.hide.py | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 exercises/001-hello_world/solution.hide.py diff --git a/exercises/001-hello_world/solution.hide.py b/exercises/001-hello_world/solution.hide.py new file mode 100644 index 00000000..0ec004ea --- /dev/null +++ b/exercises/001-hello_world/solution.hide.py @@ -0,0 +1,2 @@ +# Your code here +print("Hello World") From 7b30dba855c31e75e126d6784321b99e23f57bfe Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 16:32:06 +0100 Subject: [PATCH 03/59] Update README.md --- exercises/002-sum_of_three_numbers/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/002-sum_of_three_numbers/README.md b/exercises/002-sum_of_three_numbers/README.md index 86b03520..83eb3dee 100644 --- a/exercises/002-sum_of_three_numbers/README.md +++ b/exercises/002-sum_of_three_numbers/README.md @@ -4,7 +4,7 @@ 1. Taking 3 numbers from the input, print their sum. Every number is given on a separate line. -## Example input: +## 📎 Example input: ```py 2 @@ -12,7 +12,7 @@ 6 ``` -## Example output: +## 📎 Example output: ```py 11 From 2b696cbcbfa2001a0b204babc5f2fc9d0f44f06e Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 16:32:44 +0100 Subject: [PATCH 04/59] Update README.es.md --- exercises/002-sum_of_three_numbers/README.es.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/002-sum_of_three_numbers/README.es.md b/exercises/002-sum_of_three_numbers/README.es.md index cbff4ae3..5a46dfd9 100644 --- a/exercises/002-sum_of_three_numbers/README.es.md +++ b/exercises/002-sum_of_three_numbers/README.es.md @@ -4,7 +4,7 @@ 1. Teniendo tres números de entrada, imprime su suma. Cada número va en una línea aparte. -## Ejemplo de entrada: +## 📎 Ejemplo de entrada: ```py 2 @@ -12,7 +12,7 @@ 6 ``` -## Ejemplo de salida: +## 📎 Ejemplo de salida: ```py 11 From 702c32d76d5cb7be41f4fca9a483c5f381ef618c Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 16:33:03 +0100 Subject: [PATCH 05/59] Update app.py --- exercises/002-sum_of_three_numbers/app.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/exercises/002-sum_of_three_numbers/app.py b/exercises/002-sum_of_three_numbers/app.py index ee0bb4b6..01b60859 100644 --- a/exercises/002-sum_of_three_numbers/app.py +++ b/exercises/002-sum_of_three_numbers/app.py @@ -2,6 +2,7 @@ first_number = int(input("First input")) second_number = int(input("Second input")) third_number = int(input("Third input")) -# print here the sum of three inputs -print(first_number+second_number) \ No newline at end of file + +# Print here the sum of all three inputs +print(first_number+second_number) From 61efcd0d635b3a5639b44ee0dcf46ab8f49c3273 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 16:47:16 +0100 Subject: [PATCH 06/59] Create solution.hide.py --- exercises/002-sum_of_three_numbers/solution.hide.py | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 exercises/002-sum_of_three_numbers/solution.hide.py diff --git a/exercises/002-sum_of_three_numbers/solution.hide.py b/exercises/002-sum_of_three_numbers/solution.hide.py new file mode 100644 index 00000000..ba0bd5fa --- /dev/null +++ b/exercises/002-sum_of_three_numbers/solution.hide.py @@ -0,0 +1,8 @@ +# Sum all three input numbers and print on the console the result +first_number = int(input("First input: ")) +second_number = int(input("Second input: ")) +third_number = int(input("Third input: ")) + + +# Print here the sum of all three inputs +print(first_number+second_number+third_number) From 9b243defab98476e001d1fa6cdab2b5829e229f2 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 16:47:25 +0100 Subject: [PATCH 07/59] Update app.py --- exercises/002-sum_of_three_numbers/app.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/002-sum_of_three_numbers/app.py b/exercises/002-sum_of_three_numbers/app.py index 01b60859..21d0f403 100644 --- a/exercises/002-sum_of_three_numbers/app.py +++ b/exercises/002-sum_of_three_numbers/app.py @@ -1,7 +1,7 @@ # Sum all three input numbers and print on the console the result -first_number = int(input("First input")) -second_number = int(input("Second input")) -third_number = int(input("Third input")) +first_number = int(input("First input: ")) +second_number = int(input("Second input: ")) +third_number = int(input("Third input: ")) # Print here the sum of all three inputs From c0e47824403bcc21ca6769d5c343bea0b2bd684e Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 17:05:53 +0100 Subject: [PATCH 08/59] Update README.md --- exercises/003-area_of_right_triangle/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/exercises/003-area_of_right_triangle/README.md b/exercises/003-area_of_right_triangle/README.md index 0b0b2754..c00a0e9f 100644 --- a/exercises/003-area_of_right_triangle/README.md +++ b/exercises/003-area_of_right_triangle/README.md @@ -4,16 +4,16 @@ 1. Complete the `area_of_triangle()` function so that it reads the length of the base and the height of a right-angled triangle and prints the area. Every number is given on a separate line. -![Image description](http://i.imgur.com/6EkzVxA.jpg) +![right triangle area formula](http://i.imgur.com/6EkzVxA.jpg) -## Ejemplo: +## 📎 Example: ```py area_of_triangle(3,5) - print(7.5) +# Output --> 7.5 ``` ## 💡 Hints: -+ If you don't know how to start solving this exercise, please, review a theory for this lesson: https://snakify.org/lessons/print_input_numbers/ ++ If you don't know how to start solving this exercise, please, review the theory for this lesson: https://snakify.org/lessons/print_input_numbers/ -+ You may also try step-by-step theory chunks: https://snakify.org/lessons/print_input_numbers/steps/1/ \ No newline at end of file ++ You may also try step-by-step theory chunks: https://snakify.org/lessons/print_input_numbers/steps/1/ From 9eb34d228f9aca5d90e88d619a4352287bd9be81 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 17:07:59 +0100 Subject: [PATCH 09/59] Update README.md --- exercises/003-area_of_right_triangle/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/003-area_of_right_triangle/README.md b/exercises/003-area_of_right_triangle/README.md index c00a0e9f..dc76bd1f 100644 --- a/exercises/003-area_of_right_triangle/README.md +++ b/exercises/003-area_of_right_triangle/README.md @@ -2,7 +2,7 @@ ## 📝 Instructions: -1. Complete the `area_of_triangle()` function so that it reads the length of the base and the height of a right-angled triangle and prints the area. Every number is given on a separate line. +1. Complete the `area_of_triangle()` function so that it reads the length of the base and the height of a right-angled triangle and prints the area. ![right triangle area formula](http://i.imgur.com/6EkzVxA.jpg) From 6ebb516287053601c1ad9acb55dd412a126a6bfd Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 17:08:02 +0100 Subject: [PATCH 10/59] Update README.es.md --- exercises/003-area_of_right_triangle/README.es.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/003-area_of_right_triangle/README.es.md b/exercises/003-area_of_right_triangle/README.es.md index 3d79f662..23d7266d 100644 --- a/exercises/003-area_of_right_triangle/README.es.md +++ b/exercises/003-area_of_right_triangle/README.es.md @@ -2,9 +2,9 @@ ## 📝 Instrucciones: -1. Completa la función `area_of_triangle()` para que que tome el largo de la base y la altura de un triángulo rectángulo e imprima su área. Cada número es dado en una línea por separado. +1. Completa la función `area_of_triangle()` para que tome el largo de la base y la altura de un triángulo rectángulo e imprima su área. -![Imagen descriptiva](http://i.imgur.com/6EkzVxA.jpg) +![triángulo rectángulo fórmula del área](http://i.imgur.com/6EkzVxA.jpg) ## Ejemplo: @@ -16,4 +16,4 @@ area_of_triangle(3,5) + Si no sabes por donde empezar este ejercicio, por favor, revisa la teoría en esta lección: https://snakify.org/lessons/print_input_numbers/ -+ También puedes intentar paso a paso con trozos de la teoría: https://snakify.org/lessons/print_input_numbers/steps/1/ \ No newline at end of file ++ También puedes intentar paso a paso con trozos de la teoría: https://snakify.org/lessons/print_input_numbers/steps/1/ From cfcfdb8539684b40331a50c9a8863df28af74a2f Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 17:08:37 +0100 Subject: [PATCH 11/59] Update solution.hide.py --- exercises/003-area_of_right_triangle/solution.hide.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/exercises/003-area_of_right_triangle/solution.hide.py b/exercises/003-area_of_right_triangle/solution.hide.py index 58d34297..6ac0c57b 100644 --- a/exercises/003-area_of_right_triangle/solution.hide.py +++ b/exercises/003-area_of_right_triangle/solution.hide.py @@ -1,7 +1,7 @@ -#Complete the function to return the area of the triangle. -def area_of_triangle(arg1, arg2): - #your code here, please remove the "None" - return arg1 * arg2 / 2 +# Complete the function to return the area of a triangle +def area_of_triangle(base, height): + # Your code here, please remove the "None" + return base * height / 2 # Testing your function -print(area_of_triangle(3, 5)) \ No newline at end of file +print(area_of_triangle(3, 5)) From 6cb29334f55e798e92d1b5734407643d683fc0b9 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 17:09:07 +0100 Subject: [PATCH 12/59] Update app.py --- exercises/003-area_of_right_triangle/app.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/003-area_of_right_triangle/app.py b/exercises/003-area_of_right_triangle/app.py index db54ac26..6b4bb318 100644 --- a/exercises/003-area_of_right_triangle/app.py +++ b/exercises/003-area_of_right_triangle/app.py @@ -1,6 +1,6 @@ -#Complete the function to return the area of the triangle. -def area_of_triangle(arg1, arg2): - #your code here, please remove the "None" +# Complete the function to return the area of a triangle +def area_of_triangle(base, height): + # Your code here, please remove the "None" return None # Testing your function From 192b2009455afdf30a83e06e99c1802759bc9c71 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 17:21:05 +0100 Subject: [PATCH 13/59] Update README.md --- exercises/004-hello_harry/README.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/exercises/004-hello_harry/README.md b/exercises/004-hello_harry/README.md index cb5743e7..f845855d 100644 --- a/exercises/004-hello_harry/README.md +++ b/exercises/004-hello_harry/README.md @@ -2,24 +2,26 @@ ## 📝 Instructions: -1. Complete the `hello_name()` function that greets the user by printing the word `Hello`, a comma, the name of the user and an exclamation mark after it. +1. Complete the `hello_name()` function that greets the user by printing the word `Hello`, a comma, the name of the user, and an exclamation mark after it. *Your function's output should strictly match the desired one, character by character. There shouldn't be any space between the name and the exclamation mark.* -## Example input: +## 📎 Example input: ```py hello_name("Harry") ``` -## Example output: +## 📎 Example output: +```text Hello, Harry! +``` ## 💡 Hints: -+ You can use '+' operator to concatenate two strings. See the lesson for details. ++ You can use `+` operator to concatenate two strings. review the lesson for details. -+ If you don't know how to start solving this assignment, please, review a theory for this lesson: https://snakify.org/lessons/print_input_numbers/ ++ If you don't know how to start solving this assignment, please review the theory for this lesson: https://snakify.org/lessons/print_input_numbers/ + You may also try step-by-step theory chunks: https://snakify.org/lessons/print_input_numbers/steps/1/ From 285155b95d70f6bd2fa0683b275f74bd828bf1b2 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 17:21:15 +0100 Subject: [PATCH 14/59] Update README.md --- exercises/003-area_of_right_triangle/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/003-area_of_right_triangle/README.md b/exercises/003-area_of_right_triangle/README.md index dc76bd1f..172539b6 100644 --- a/exercises/003-area_of_right_triangle/README.md +++ b/exercises/003-area_of_right_triangle/README.md @@ -14,6 +14,6 @@ area_of_triangle(3,5) ``` ## 💡 Hints: -+ If you don't know how to start solving this exercise, please, review the theory for this lesson: https://snakify.org/lessons/print_input_numbers/ ++ If you don't know how to start solving this exercise, please review the theory for this lesson: https://snakify.org/lessons/print_input_numbers/ + You may also try step-by-step theory chunks: https://snakify.org/lessons/print_input_numbers/steps/1/ From abc39072fe7b3239b3e8ef07730635feb2156f95 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 17:23:28 +0100 Subject: [PATCH 15/59] Update README.es.md --- exercises/004-hello_harry/README.es.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/exercises/004-hello_harry/README.es.md b/exercises/004-hello_harry/README.es.md index 22798332..55b1c51c 100644 --- a/exercises/004-hello_harry/README.es.md +++ b/exercises/004-hello_harry/README.es.md @@ -6,21 +6,21 @@ *La salida de tu función debe coincidir estrictamente con la deseada, caracter por caracter. No debe haber ningún espacio entre el nombre y el signo de exclamación.* -## Ejemplo entrada: +## 📎 Ejemplo de entrada: ```py hello_name("Harry") ``` -## Ejemplo de salida: +## 📎 Ejemplo de salida: +```text Hello, Harry! +``` ## 💡 Pistas: -+ Puedes usar el operador '+' para concatenar dos strings de texto. Ve la lección para más detalles. ++ Puedes usar el operador `+` para concatenar dos strings de texto. Repasa la lección para más detalles. -+ Si no sabes por donde partir este ejercicio por favor, revisa la teoría en esta lección: -https://snakify.org/lessons/print_input_numbers/ ++ Si no sabes por donde empezar este ejercicio, por favor, revisa la teoría en esta lección: https://snakify.org/lessons/print_input_numbers/ -+ También puedes intentar paso a paso con trozos de la teoría: -https://snakify.org/lessons/print_input_numbers/steps/1/ ++ También puedes intentar paso a paso con trozos de la teoría: https://snakify.org/lessons/print_input_numbers/steps/1/ From 4eaf160cf668706344db98f7ec69014691203cd2 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 17:26:15 +0100 Subject: [PATCH 16/59] Update app.py --- exercises/004-hello_harry/app.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/004-hello_harry/app.py b/exercises/004-hello_harry/app.py index e2d36d22..4d3f3e24 100644 --- a/exercises/004-hello_harry/app.py +++ b/exercises/004-hello_harry/app.py @@ -1,7 +1,7 @@ -#Complete the function below to print the output per the example. +# Complete the function below to print the output as per the example def hello_name(name): - + # Your code here return None -#Invoke the function with your name as the function's argument. +# Invoke the function with your name as the function's argument print(hello_name("Bob")) From e18e11c5ba5bf6862adbb2efe4a1a8542eb88fac Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 17:26:55 +0100 Subject: [PATCH 17/59] Update solution.hide.py --- exercises/004-hello_harry/solution.hide.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/004-hello_harry/solution.hide.py b/exercises/004-hello_harry/solution.hide.py index 8e7c0e41..63539e80 100644 --- a/exercises/004-hello_harry/solution.hide.py +++ b/exercises/004-hello_harry/solution.hide.py @@ -1,7 +1,7 @@ -#Complete the function below to print the output per the example. +# Complete the function below to print the output as per the example def hello_name(name): - + # Your code here return "Hello, "+name+"!" -#Invoke the function with your name as the function's argument. +# Invoke the function with your name as the function's argument print(hello_name("Bob")) From 229e68521fb2ed79d6f6a130f47a204739682283 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 17:28:31 +0100 Subject: [PATCH 18/59] Update README.es.md --- exercises/004-hello_harry/README.es.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/004-hello_harry/README.es.md b/exercises/004-hello_harry/README.es.md index 55b1c51c..064d4bc2 100644 --- a/exercises/004-hello_harry/README.es.md +++ b/exercises/004-hello_harry/README.es.md @@ -2,7 +2,7 @@ ## 📝 Instrucciones: -1. Completa la función `hello_name()` para que salude al usuario imprimiendo la palabra `Hello`, luego le agregue una coma, el nombre del usuario y un signo de exclamación después de él. +1. Completa la función `hello_name()` para que salude al usuario imprimiendo la palabra `Hello`, luego le agregue una coma, el nombre del usuario y un signo de exclamación después. *La salida de tu función debe coincidir estrictamente con la deseada, caracter por caracter. No debe haber ningún espacio entre el nombre y el signo de exclamación.* From 20f743109691d88b530dccca968062a1d1e6e310 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 17:33:36 +0100 Subject: [PATCH 19/59] Update README.md --- exercises/005-previous_and_next/README.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/exercises/005-previous_and_next/README.md b/exercises/005-previous_and_next/README.md index e26caf6e..cc2aef57 100644 --- a/exercises/005-previous_and_next/README.md +++ b/exercises/005-previous_and_next/README.md @@ -4,14 +4,17 @@ 1. Complete a function `previous_next()` that reads an integer number and returns its previous and next numbers. -## Example input: +## 📎 Example input: ```py previous_next(179) ``` -## Example output: -+ (178, 180) +## 📎 Example output: + +```py +178, 180 +``` ## 💡 Hints: @@ -19,4 +22,4 @@ previous_next(179) + If you don't know how to start solving this assignment, please, review a theory for this lesson: https://snakify.org/lessons/print_input_numbers/ -+ You may also try step-by-step theory chunks: https://snakify.org/lessons/print_input_numbers/steps/1/ \ No newline at end of file ++ You may also try step-by-step theory chunks: https://snakify.org/lessons/print_input_numbers/steps/1/ From cf52281791b846ee1940b396d25f67a22e1c4302 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 17:34:53 +0100 Subject: [PATCH 20/59] Update README.es.md --- exercises/005-previous_and_next/README.es.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/exercises/005-previous_and_next/README.es.md b/exercises/005-previous_and_next/README.es.md index 8607726d..d1df541d 100644 --- a/exercises/005-previous_and_next/README.es.md +++ b/exercises/005-previous_and_next/README.es.md @@ -4,20 +4,22 @@ 1. Completa la función `previous_next()` para que lea un número entero y devuelva sus números anteriores y siguientes. -## Ejemplo: +## 📎 Ejemplo de entrada: ```py previous_next(179) ``` -## Ejemplo de salida: +## 📎 Ejemplo de salida: -+ (178, 180) +```text +178, 180 +``` ## 💡 Pistas: -+ Puedes devolver múltiples parámetros: return a, b ++ Puedes devolver múltiples parámetros: `return a, b` + Si no sabes por donde partir este ejercicio, por favor revisa la teoría en esta lección: https://snakify.org/lessons/print_input_numbers/ -+ También puedes intentar paso a paso con trozos de la teoría: https://snakify.org/lessons/print_input_numbers/steps/1/ \ No newline at end of file ++ También puedes intentar paso a paso con trozos de la teoría: https://snakify.org/lessons/print_input_numbers/steps/1/ From 62f2812c6225bda1e245b73cdd4c28bc3b6f2f84 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 17:35:02 +0100 Subject: [PATCH 21/59] Update README.md --- exercises/005-previous_and_next/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/005-previous_and_next/README.md b/exercises/005-previous_and_next/README.md index cc2aef57..4c45cba3 100644 --- a/exercises/005-previous_and_next/README.md +++ b/exercises/005-previous_and_next/README.md @@ -18,7 +18,7 @@ previous_next(179) ## 💡 Hints: -+ You can return multiple parameters: return a, b ++ You can return multiple parameters: `return a, b` + If you don't know how to start solving this assignment, please, review a theory for this lesson: https://snakify.org/lessons/print_input_numbers/ From 594cd5ba0e70f1f962ca36787d29c8b9c443e5d8 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 17:35:15 +0100 Subject: [PATCH 22/59] Update README.es.md --- exercises/005-previous_and_next/README.es.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/005-previous_and_next/README.es.md b/exercises/005-previous_and_next/README.es.md index d1df541d..33e3b143 100644 --- a/exercises/005-previous_and_next/README.es.md +++ b/exercises/005-previous_and_next/README.es.md @@ -12,7 +12,7 @@ previous_next(179) ## 📎 Ejemplo de salida: -```text +```py 178, 180 ``` From 348d11fc08dcaaa18d7afdbb2b810f1c5db37093 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 17:48:34 +0100 Subject: [PATCH 23/59] Update README.es.md --- exercises/003-area_of_right_triangle/README.es.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/exercises/003-area_of_right_triangle/README.es.md b/exercises/003-area_of_right_triangle/README.es.md index 23d7266d..b297ab54 100644 --- a/exercises/003-area_of_right_triangle/README.es.md +++ b/exercises/003-area_of_right_triangle/README.es.md @@ -6,12 +6,13 @@ ![triángulo rectángulo fórmula del área](http://i.imgur.com/6EkzVxA.jpg) -## Ejemplo: +## 📎 Ejemplo: ```py area_of_triangle(3,5) - print(7.5) +# Salida --> 7.5 ``` + ## 💡 Pistas: + Si no sabes por donde empezar este ejercicio, por favor, revisa la teoría en esta lección: https://snakify.org/lessons/print_input_numbers/ From 48aaf282a0e067aa678ddf18dc2b2e79f34f14d1 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 17:49:48 +0100 Subject: [PATCH 24/59] Update app.py --- exercises/005-previous_and_next/app.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/005-previous_and_next/app.py b/exercises/005-previous_and_next/app.py index 930240fa..518bea44 100644 --- a/exercises/005-previous_and_next/app.py +++ b/exercises/005-previous_and_next/app.py @@ -1,7 +1,7 @@ -#Complete the function to return the previous and next number of a given numner.". +# Complete the function to return the previous and next number of a given number def previous_next(num): return None -#Invoke the function with any interger at its argument. -print(previous_next(179)) \ No newline at end of file +# Invoke the function with any integer as its argument. +print(previous_next(179)) From fe35e4239c18ee017ed88c31be80002a83345b2e Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 17:51:09 +0100 Subject: [PATCH 25/59] Update app.py --- exercises/005-previous_and_next/app.py | 1 + 1 file changed, 1 insertion(+) diff --git a/exercises/005-previous_and_next/app.py b/exercises/005-previous_and_next/app.py index 518bea44..1049b2dd 100644 --- a/exercises/005-previous_and_next/app.py +++ b/exercises/005-previous_and_next/app.py @@ -1,5 +1,6 @@ # Complete the function to return the previous and next number of a given number def previous_next(num): + # Your code here return None From 38d117512f578b66b9990527b10db36d727fd0a9 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 17:51:21 +0100 Subject: [PATCH 26/59] Update solution.hide.py --- exercises/005-previous_and_next/solution.hide.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/exercises/005-previous_and_next/solution.hide.py b/exercises/005-previous_and_next/solution.hide.py index 4280c6e7..2ad13bdd 100644 --- a/exercises/005-previous_and_next/solution.hide.py +++ b/exercises/005-previous_and_next/solution.hide.py @@ -1,7 +1,8 @@ #Complete the function to return the previous and next number of a given numner.". def previous_next(num): + # Your code here return (num-1, num+1) #Invoke the function with any interger at its argument. -print(previous_next(179)) \ No newline at end of file +print(previous_next(179)) From 517cfba0054b7d760bde88a165135624c37479a0 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 17:51:46 +0100 Subject: [PATCH 27/59] Update solution.hide.py --- exercises/005-previous_and_next/solution.hide.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/005-previous_and_next/solution.hide.py b/exercises/005-previous_and_next/solution.hide.py index 2ad13bdd..087754f1 100644 --- a/exercises/005-previous_and_next/solution.hide.py +++ b/exercises/005-previous_and_next/solution.hide.py @@ -1,8 +1,8 @@ -#Complete the function to return the previous and next number of a given numner.". +# Complete the function to return the previous and next number of a given number def previous_next(num): # Your code here return (num-1, num+1) -#Invoke the function with any interger at its argument. +# Invoke the function with any integer as its argument. print(previous_next(179)) From 17781d2bb9d2ff5600c9011ca9ed06e14500d1b1 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 17:52:57 +0100 Subject: [PATCH 28/59] Update README.md --- exercises/005-previous_and_next/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/005-previous_and_next/README.md b/exercises/005-previous_and_next/README.md index 4c45cba3..d96268d9 100644 --- a/exercises/005-previous_and_next/README.md +++ b/exercises/005-previous_and_next/README.md @@ -13,7 +13,7 @@ previous_next(179) ## 📎 Example output: ```py -178, 180 +(178, 180) ``` ## 💡 Hints: From 6f92525d642f55fb00f8162c9fb66a15ac696854 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 17:53:05 +0100 Subject: [PATCH 29/59] Update README.es.md --- exercises/005-previous_and_next/README.es.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/005-previous_and_next/README.es.md b/exercises/005-previous_and_next/README.es.md index 33e3b143..25b313eb 100644 --- a/exercises/005-previous_and_next/README.es.md +++ b/exercises/005-previous_and_next/README.es.md @@ -13,7 +13,7 @@ previous_next(179) ## 📎 Ejemplo de salida: ```py -178, 180 +(178, 180) ``` ## 💡 Pistas: From 8ce46ca9c4731236f7811666f9389ac991931ca7 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 17:54:51 +0100 Subject: [PATCH 30/59] Update test.py --- exercises/005-previous_and_next/test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/005-previous_and_next/test.py b/exercises/005-previous_and_next/test.py index a953748d..77bead1c 100644 --- a/exercises/005-previous_and_next/test.py +++ b/exercises/005-previous_and_next/test.py @@ -8,7 +8,7 @@ def test_for_functon_existence(capsys, app): def test_function_return(capsys, app): assert app.previous_next(6) != None -@pytest.mark.it('The function return a tuple') +@pytest.mark.it('The function should return a tuple') def test_function_return_type(capsys, app): result = app.previous_next(6) assert type(result) == type((1,2)) From 95240701306abf3440ca0231a118846b7cec6a00 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 17:55:10 +0100 Subject: [PATCH 31/59] Update app.py --- exercises/005-previous_and_next/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/005-previous_and_next/app.py b/exercises/005-previous_and_next/app.py index 1049b2dd..d549fb0d 100644 --- a/exercises/005-previous_and_next/app.py +++ b/exercises/005-previous_and_next/app.py @@ -4,5 +4,5 @@ def previous_next(num): return None -# Invoke the function with any integer as its argument. +# Invoke the function with any integer as its argument print(previous_next(179)) From 065219c8a4cfbfee5e8713854369d5ba605d288c Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 17:55:15 +0100 Subject: [PATCH 32/59] Update solution.hide.py --- exercises/005-previous_and_next/solution.hide.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/005-previous_and_next/solution.hide.py b/exercises/005-previous_and_next/solution.hide.py index 087754f1..f38fad1b 100644 --- a/exercises/005-previous_and_next/solution.hide.py +++ b/exercises/005-previous_and_next/solution.hide.py @@ -4,5 +4,5 @@ def previous_next(num): return (num-1, num+1) -# Invoke the function with any integer as its argument. +# Invoke the function with any integer as its argument print(previous_next(179)) From 7baaa30d843842ff2ead38c2328f0b5e7fd74b1f Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 18:00:31 +0100 Subject: [PATCH 33/59] Update README.md --- exercises/006-apple_sharing/README.md | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/exercises/006-apple_sharing/README.md b/exercises/006-apple_sharing/README.md index cbde1805..01bf5df7 100644 --- a/exercises/006-apple_sharing/README.md +++ b/exercises/006-apple_sharing/README.md @@ -2,25 +2,24 @@ ## 📝 Instructions: -1. `N` students take `K` apples and distribute them among each other evenly. The remaining (the indivisible) part remains in the basket. How many apples will each single student get and how many apples will remain in the basket? *The function reads the numbers `N` and `K` and it should return the two answers for the questions above.* +1. `N` students take `K` apples and distribute them among each other evenly. The remaining (the indivisible) part remains in the basket. How many apples will each single student get, and how many apples will remain in the basket? *The function reads the numbers `N` and `K` and it should return the two answers for the questions above.* -## Example input: +## 📎 Example input: ```py apple_sharing(6, 50) ``` -## Example output: - -+ (8, 2) +## 📎 Example output: +```py +(8, 2) +``` ## 💡 Hints: -+ You can return multiple parameters: return a, b ++ You can return multiple parameters: `return a, b` -+ If you don't know how to start solving this assignment, please, review a theory for this lesson: -https://snakify.org/lessons/print_input_numbers/ ++ If you don't know how to start solving this assignment, please review the theory for this lesson: https://snakify.org/lessons/print_input_numbers/ -+ You may also try step-by-step theory chunks: -https://snakify.org/lessons/print_input_numbers/steps/1/ \ No newline at end of file ++ You may also try step-by-step theory chunks: https://snakify.org/lessons/print_input_numbers/steps/1/ From f5dff5793f5393318140754487ff0c0ef51309c2 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 18:00:59 +0100 Subject: [PATCH 34/59] Update README.md --- exercises/006-apple_sharing/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/006-apple_sharing/README.md b/exercises/006-apple_sharing/README.md index 01bf5df7..0126196b 100644 --- a/exercises/006-apple_sharing/README.md +++ b/exercises/006-apple_sharing/README.md @@ -2,7 +2,7 @@ ## 📝 Instructions: -1. `N` students take `K` apples and distribute them among each other evenly. The remaining (the indivisible) part remains in the basket. How many apples will each single student get, and how many apples will remain in the basket? *The function reads the numbers `N` and `K` and it should return the two answers for the questions above.* +1. `N` students take `K` apples and distribute them among each other evenly. The remaining (indivisible) part remains in the basket. How many apples will each single student get, and how many apples will remain in the basket? *The function reads the numbers `N` and `K` and it should return the two answers for the questions above.* ## 📎 Example input: From 63d8a5ce296f5bb99b3f889bf75990b81b89761b Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 18:06:12 +0100 Subject: [PATCH 35/59] Update README.es.md --- exercises/006-apple_sharing/README.es.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/exercises/006-apple_sharing/README.es.md b/exercises/006-apple_sharing/README.es.md index 1905f10f..09779725 100644 --- a/exercises/006-apple_sharing/README.es.md +++ b/exercises/006-apple_sharing/README.es.md @@ -2,24 +2,24 @@ ## 📝 Instrucciones: -1. `N` estudiantes cogen `K` manzanas y las distribuyen entre ell@s de manera uniforme. La parte restante (la indivisible) permanece en la cesta. ¿Cuántas manzanas recibirá cada estudiante? y ¿Cuántas manzanas quedarán en la cesta? *Esta función lee los números `N` y `K` y debería devolver la respuesta a ambas preguntas.* +1. `N` estudiantes cogen `K` manzanas y las distribuyen entre ellos de manera uniforme. La parte restante (indivisible) permanece en la cesta. ¿Cuántas manzanas recibirá cada estudiante? y ¿Cuántas manzanas quedarán en la cesta? *Esta función lee los números `N` y `K` y debería devolver la respuesta a ambas preguntas.* -## Ejemplo de entrada: +## 📎 Ejemplo de entrada: ```py apple_sharing(6, 50) ``` -## Ejemplo de salida: +## 📎 Ejemplo de salida: -+ (8, 2) +```py +(8, 2) +``` ## 💡 Pistas: -+ Puedes devolver múltiples parámetros: return a, b ++ Puedes devolver múltiples parámetros: `return a, b` -+ Si no sabes por donde partir este ejercicio por favor, revisa la teoría en esta lección: -https://snakify.org/lessons/print_input_numbers/ ++ Si no sabes por donde partir este ejercicio, por favor, revisa la teoría en esta lección: https://snakify.org/lessons/print_input_numbers/ -+ También puedes intentar paso a paso con trozos de la teoría: -https://snakify.org/lessons/print_input_numbers/steps/1/ \ No newline at end of file ++ También puedes intentar paso a paso con trozos de la teoría: https://snakify.org/lessons/print_input_numbers/steps/1/ From e24a5f8099c711409cb36ee9de48815095a32a5d Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 18:07:17 +0100 Subject: [PATCH 36/59] Update README.es.md --- exercises/006-apple_sharing/README.es.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/006-apple_sharing/README.es.md b/exercises/006-apple_sharing/README.es.md index 09779725..dcbeb594 100644 --- a/exercises/006-apple_sharing/README.es.md +++ b/exercises/006-apple_sharing/README.es.md @@ -4,7 +4,7 @@ 1. `N` estudiantes cogen `K` manzanas y las distribuyen entre ellos de manera uniforme. La parte restante (indivisible) permanece en la cesta. ¿Cuántas manzanas recibirá cada estudiante? y ¿Cuántas manzanas quedarán en la cesta? *Esta función lee los números `N` y `K` y debería devolver la respuesta a ambas preguntas.* -## 📎 Ejemplo de entrada: +## 📎 Ejemplo de entrada: ```py apple_sharing(6, 50) From e63167385ccb0d671970a7ac35e8231e389978cf Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 18:09:01 +0100 Subject: [PATCH 37/59] Update app.py --- exercises/006-apple_sharing/app.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/exercises/006-apple_sharing/app.py b/exercises/006-apple_sharing/app.py index 6529a8a9..2c17d877 100644 --- a/exercises/006-apple_sharing/app.py +++ b/exercises/006-apple_sharing/app.py @@ -1,12 +1,6 @@ -#Complete the function to return: -#1) How many apples each single student will get. -#2) How many apples wil remain in the basket. -#Hint: You can resolve this exercise either importing the math module or without it def apple_sharing(n,k): - + # Your code here return None - -#Print the two answer per the example output. -print(apple_sharing(6,50)) \ No newline at end of file +print(apple_sharing(6,50)) From f8471ab2dfdfebacd49c19394daacaf5af0f5db0 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 18:10:44 +0100 Subject: [PATCH 38/59] Update solution.hide.py --- exercises/006-apple_sharing/solution.hide.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/exercises/006-apple_sharing/solution.hide.py b/exercises/006-apple_sharing/solution.hide.py index 6cccd262..dcf9d01f 100644 --- a/exercises/006-apple_sharing/solution.hide.py +++ b/exercises/006-apple_sharing/solution.hide.py @@ -1,12 +1,6 @@ -#Complete the function to return: -#1) How many apples each single student will get. -#2) How many apples wil remain in the basket. -#Hint: You can resolve this exercise either importing the math module or without it def apple_sharing(n,k): - + # Your code here return (round(k/n),k%n) - -#Print the two answer per the example output. -print(apple_sharing(6,50)) \ No newline at end of file +print(apple_sharing(6,50)) From 09c4af5f8b4fc07a85131f397437ae16cbce1ca2 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 18:16:51 +0100 Subject: [PATCH 39/59] Update solution.hide.py --- exercises/006-apple_sharing/solution.hide.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/006-apple_sharing/solution.hide.py b/exercises/006-apple_sharing/solution.hide.py index dcf9d01f..8f7e1de6 100644 --- a/exercises/006-apple_sharing/solution.hide.py +++ b/exercises/006-apple_sharing/solution.hide.py @@ -1,6 +1,6 @@ def apple_sharing(n,k): # Your code here - return (round(k/n),k%n) + return (round(k/n), k%n) print(apple_sharing(6,50)) From 9a84243f1c5cd5d5ca873e0a9b76ef82fbf7612e Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 18:17:57 +0100 Subject: [PATCH 40/59] Update README.md --- exercises/006.1-square_value_of_number/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/exercises/006.1-square_value_of_number/README.md b/exercises/006.1-square_value_of_number/README.md index 8e89d0bf..c75ea74d 100644 --- a/exercises/006.1-square_value_of_number/README.md +++ b/exercises/006.1-square_value_of_number/README.md @@ -1,16 +1,16 @@ # `006.1` square value of number -## 📝 Instructions +## 📝 Instructions: 1. Write a function called `square()` that calculates the square value of a number. -## Example input: +## 📎 Example input: ```py square(6) ``` -## Example output: +## 📎 Example output: ```py 36 @@ -18,4 +18,4 @@ square(6) ## 💡 Hint: -+ Using the `**` operator ++ Using the `**` operator. From 6eab420865c524e4af1c6ad9b14802c690846e6d Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 18:18:38 +0100 Subject: [PATCH 41/59] Update README.es.md --- exercises/006.1-square_value_of_number/README.es.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/exercises/006.1-square_value_of_number/README.es.md b/exercises/006.1-square_value_of_number/README.es.md index 4555fe4b..e2f4257d 100644 --- a/exercises/006.1-square_value_of_number/README.es.md +++ b/exercises/006.1-square_value_of_number/README.es.md @@ -2,19 +2,20 @@ ## 📝 Instrucciones: -1. Escribe una función llamada `square()` que calcule el valor al cuadrado de un número +1. Escribe una función llamada `square()` que calcule el valor al cuadrado de un número. -## Ejemplo de entrada: +## 📎 Ejemplo de entrada: ```py square(6) ``` -## Ejemplo de salida: +## 📎 Ejemplo de salida: ```py 36 ``` + ## 💡 Pista: + Usa el operador `**`. From a0496c6d066124f3bff9998b0b17b87a5561b1c9 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 18:19:12 +0100 Subject: [PATCH 42/59] Update app.py --- exercises/006.1-square_value_of_number/app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/006.1-square_value_of_number/app.py b/exercises/006.1-square_value_of_number/app.py index 42d75244..086d1e41 100644 --- a/exercises/006.1-square_value_of_number/app.py +++ b/exercises/006.1-square_value_of_number/app.py @@ -1,5 +1,5 @@ -# your code here def square(num): + # Your code here return None -print(square(6)) \ No newline at end of file +print(square(6)) From 8bc0d06dc80fc2486d4bf37d62bf7486adfb3c42 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 18:19:34 +0100 Subject: [PATCH 43/59] Update solution.hide.py --- exercises/006.1-square_value_of_number/solution.hide.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/006.1-square_value_of_number/solution.hide.py b/exercises/006.1-square_value_of_number/solution.hide.py index 5b5ecf75..af655b88 100644 --- a/exercises/006.1-square_value_of_number/solution.hide.py +++ b/exercises/006.1-square_value_of_number/solution.hide.py @@ -1,5 +1,5 @@ def square(num): + # Your code here return num ** 2 -print(square(2)) -print(square(3)) \ No newline at end of file +print(square(3)) From 921abdd1617c036a1ab3fdc3177d1cdf998bd474 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 18:19:43 +0100 Subject: [PATCH 44/59] Update solution.hide.py --- exercises/006.1-square_value_of_number/solution.hide.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/006.1-square_value_of_number/solution.hide.py b/exercises/006.1-square_value_of_number/solution.hide.py index af655b88..b2fc5d77 100644 --- a/exercises/006.1-square_value_of_number/solution.hide.py +++ b/exercises/006.1-square_value_of_number/solution.hide.py @@ -2,4 +2,4 @@ def square(num): # Your code here return num ** 2 -print(square(3)) +print(square(6)) From 95d6272b05cbfb8ce4992a58bd2d0852c2ae479f Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 18:20:23 +0100 Subject: [PATCH 45/59] Update test.py --- exercises/006.1-square_value_of_number/test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/006.1-square_value_of_number/test.py b/exercises/006.1-square_value_of_number/test.py index 8bb35b61..4f46fe8e 100644 --- a/exercises/006.1-square_value_of_number/test.py +++ b/exercises/006.1-square_value_of_number/test.py @@ -13,11 +13,11 @@ def test_function_return_type(capsys, app): result = app.square(6) assert type(result) == type(1) -@pytest.mark.it('The function should return the square of the given number.') +@pytest.mark.it('The function should return the square of the given number') def test_for_file_output(capsys, app): assert app.square(6) == 6*6 -@pytest.mark.it('The function should return the square of the given number. Testing with 47.') +@pytest.mark.it('The function should return the square of the given number. Testing with 47') def test_for_file_output(capsys, app): assert app.square(47) == 47*47 From e6561bf4564e65be2e0c31726f4cc34c47f75149 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 18:45:16 +0100 Subject: [PATCH 46/59] Update README.md --- exercises/007-hours_and_minutes/README.md | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/exercises/007-hours_and_minutes/README.md b/exercises/007-hours_and_minutes/README.md index c895becd..6769f961 100644 --- a/exercises/007-hours_and_minutes/README.md +++ b/exercises/007-hours_and_minutes/README.md @@ -1,34 +1,27 @@ # `007` Hours and Minutes -In this exercise we are going to suppose that it is midnight, we want that with the function `hours_minutes` that we have provided to you, you were able to tell us how much time has passed since then with the seconds that are introduced as parameter. +Complete the function `hours_minutes` to transform the given number of seconds into hours and minutes, indicating how much time has passed since then. ## 📝 Instructions: 1. Complete the function to return the expected result. -2. Perform two calculations with the seconds that are passed by parameter in the function so that one calculates the time according to the seconds that have passed and the other to know the minutes `(hour , minutes)`. +2. Perform two calculations based on the input parameter representing seconds. One calculation should determine the time elapsed in hours, while the other should indicate the time in minutes `(hours, minutes)`. -## Example 1: +## 📎 Example 1: ```py output = hours_minutes(3900) -print(output) # (1, 5) +print(output) # (1, 5) ``` -## Example 2: +## 📎 Example 2: ```py output = hours_minutes(60) -print(output) # (0, 1) +print(output) # (0, 1) ``` -## 💡 Hints: +## 💡 Hint: + Remember how many seconds there are in an hour (3600) and how many seconds in a minute (60). - -+ If you don't know how to start solving this assignment, please, review a theory for this lesson: https://snakify.org/lessons/print_input_numbers/ - -+ You may also try step-by-step theory chunks: https://snakify.org/lessons/print_input_numbers/steps/1/ - - -[comment]: From 450704678a7afe465a8715ac784f701d6d30cb36 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 18:47:48 +0100 Subject: [PATCH 47/59] Update README.es.md --- exercises/007-hours_and_minutes/README.es.md | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/exercises/007-hours_and_minutes/README.es.md b/exercises/007-hours_and_minutes/README.es.md index 8db18b3d..8b99540d 100644 --- a/exercises/007-hours_and_minutes/README.es.md +++ b/exercises/007-hours_and_minutes/README.es.md @@ -1,33 +1,27 @@ # `007` Hours and minutes -En este ejercicio vamos a suponer que es medianoche, queremos que con la función `hours_minutes` que hemos previsto para tí, nos digas cuánto tiempo ha pasado desde entonces con los segundos que se introduzcan como parámetro. +Queremos que con la función `hours_minutes` que hemos previsto para ti, nos digas cuánto tiempo ha pasado desde entonces con los segundos que se introduzcan como parámetro. ## 📝 Instrucciones: 1. Completa la función para que retorne el resultado esperado. -2. Realiza dos calculos con los segundos que se pasan por parámetro en la función para que uno calcule la hora según los segundos que han pasado y el otro para saber los minutos `(hora , minutos)` +2. Realiza dos cálculos con los segundos que se pasan por parámetro en la función para que uno calcule la hora según los segundos que han pasado y el otro para saber los minutos `(horas, minutos)` -## Ejemplo 1: +## 📎 Ejemplo 1: ```py output = hours_minutes(3900) -print(output) # (1, 5) +print(output) # (1, 5) ``` -## Ejemplo 2: +## 📎 Ejemplo 2: ```py output = hours_minutes(60) -print(output) # (0, 1) +print(output) # (0, 1) ``` -## 💡 Pistas: +## 💡 Pista: + Recuerda cuantos segundos hay en una hora (3600) y cuantos segundos en un minuto (60). - -+ Si no sabes cómo empezar la solución a esta asignación, por favor, revisa la teoría en esta lección: https://snakify.org/lessons/print_input_numbers/ - -+ También puedes intentar paso a paso con trozos de la teoría: https://snakify.org/lessons/print_input_numbers/steps/1/ - -[comment]: \ No newline at end of file From 5a3e368b706a74caaf549414cda9eeee19efabd6 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 18:56:04 +0100 Subject: [PATCH 48/59] Update README.es.md --- exercises/007-hours_and_minutes/README.es.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/007-hours_and_minutes/README.es.md b/exercises/007-hours_and_minutes/README.es.md index 8b99540d..ec2be2e5 100644 --- a/exercises/007-hours_and_minutes/README.es.md +++ b/exercises/007-hours_and_minutes/README.es.md @@ -6,7 +6,7 @@ Queremos que con la función `hours_minutes` que hemos previsto para ti, nos dig 1. Completa la función para que retorne el resultado esperado. -2. Realiza dos cálculos con los segundos que se pasan por parámetro en la función para que uno calcule la hora según los segundos que han pasado y el otro para saber los minutos `(horas, minutos)` +2. Realiza dos cálculos con los segundos que se pasan por parámetro en la función para que uno calcule la hora según los segundos que han pasado y el otro para saber los minutos `(horas, minutos)`. ## 📎 Ejemplo 1: From 7a1d8cc135aa0b18e19b308aee012bb736cc121c Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 18:56:59 +0100 Subject: [PATCH 49/59] Update README.es.md --- exercises/007-hours_and_minutes/README.es.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/007-hours_and_minutes/README.es.md b/exercises/007-hours_and_minutes/README.es.md index ec2be2e5..dd12f1db 100644 --- a/exercises/007-hours_and_minutes/README.es.md +++ b/exercises/007-hours_and_minutes/README.es.md @@ -1,6 +1,6 @@ # `007` Hours and minutes -Queremos que con la función `hours_minutes` que hemos previsto para ti, nos digas cuánto tiempo ha pasado desde entonces con los segundos que se introduzcan como parámetro. +Queremos que con la función `hours_minutes` que hemos previsto para ti, nos digas cuánto tiempo ha pasado en horas y minutos desde entonces con los segundos que se introduzcan como parámetro. ## 📝 Instrucciones: From 2bce90068e5bc1b8e7eff35c2da56a0f2580f2bd Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 18:57:57 +0100 Subject: [PATCH 50/59] Update app.py --- exercises/007-hours_and_minutes/app.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/exercises/007-hours_and_minutes/app.py b/exercises/007-hours_and_minutes/app.py index 8954a0c8..2e165499 100644 --- a/exercises/007-hours_and_minutes/app.py +++ b/exercises/007-hours_and_minutes/app.py @@ -1,7 +1,6 @@ -#Complete the function to calculate how many hours and minutes are passed since midnight. def hours_minutes(secs): - + # Your code here return None -#Invoke the funtion and pass any interger as its argument. -print(hours_minutes(3900)) \ No newline at end of file +# Invoke the function and pass any integer as its argument +print(hours_minutes(3900)) From 02ab803c8b29a3e180a245c3aa11710be65ac4f0 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 19:04:36 +0100 Subject: [PATCH 51/59] Update solution.hide.py --- exercises/007-hours_and_minutes/solution.hide.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/007-hours_and_minutes/solution.hide.py b/exercises/007-hours_and_minutes/solution.hide.py index 351f8d71..11657804 100644 --- a/exercises/007-hours_and_minutes/solution.hide.py +++ b/exercises/007-hours_and_minutes/solution.hide.py @@ -1,9 +1,9 @@ -#Complete the function to calculate how many hours and minutes are passed since midnight. def hours_minutes(secs): + # Your code here minutes = secs // 60 hours = minutes // 60 minutes = minutes % 60 return (hours, minutes) -#Invoke the funtion and pass any interger as its argument. -print(hours_minutes(3900)) \ No newline at end of file +# Invoke the function and pass any integer as its argument +print(hours_minutes(3900)) From bf5ce848476ae303a899e94363f9dc16aae28a22 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 19:16:35 +0100 Subject: [PATCH 52/59] Update solution.hide.py --- exercises/007-hours_and_minutes/solution.hide.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/exercises/007-hours_and_minutes/solution.hide.py b/exercises/007-hours_and_minutes/solution.hide.py index 11657804..e5b96c68 100644 --- a/exercises/007-hours_and_minutes/solution.hide.py +++ b/exercises/007-hours_and_minutes/solution.hide.py @@ -1,8 +1,8 @@ -def hours_minutes(secs): +def hours_minutes(seconds): # Your code here - minutes = secs // 60 - hours = minutes // 60 - minutes = minutes % 60 + hours = seconds // 3600 + remaining_seconds = seconds % 3600 + minutes = remaining_seconds // 60 return (hours, minutes) # Invoke the function and pass any integer as its argument From 667b3b160f58bbbf1706c47d0a2ae632e88d9604 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 19:16:55 +0100 Subject: [PATCH 53/59] Update app.py --- exercises/007-hours_and_minutes/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/007-hours_and_minutes/app.py b/exercises/007-hours_and_minutes/app.py index 2e165499..14ce499b 100644 --- a/exercises/007-hours_and_minutes/app.py +++ b/exercises/007-hours_and_minutes/app.py @@ -1,4 +1,4 @@ -def hours_minutes(secs): +def hours_minutes(seconds): # Your code here return None From dea53a98bbd7ddc6e3477051eec68da3d0a079ad Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 19:24:56 +0100 Subject: [PATCH 54/59] Update README.md --- exercises/008-two_timestamps/README.md | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/exercises/008-two_timestamps/README.md b/exercises/008-two_timestamps/README.md index b87af83c..51961e29 100644 --- a/exercises/008-two_timestamps/README.md +++ b/exercises/008-two_timestamps/README.md @@ -2,30 +2,18 @@ ## 📝 Instructions: -1. Given two timestamps of the same day: a number of hours, minutes and seconds for both of the timestamps. The moment of the first timestamp happened before the moment of the second one. Calculate how many seconds passed between them. +1. Given two timestamps of the same day: a number of hours, minutes and seconds for both of the timestamps. The moment of the first timestamp happened before the moment of the second one. Calculate how many seconds passed between them. -## Example input #1: +## 📎 Example 1: ```py -two_timestamp(1,1,1,2,2,2) +output = two_timestamp(1,1,1,2,2,2) +print(output) # 3661 ``` -## Example output #1: - -+ 3661 - -## Example input #2: +## 📎 Example 2: ```py -two_timestamp(1,2,30,1,3,20) +output = two_timestamp(1,2,30,1,3,20) +print(output) # 50 ``` - -## Example output #2: - -+ 50 - -## 💡 Hints: - -+ If you don't know how to start solving this assignment, please, review a theory for this lesson: https://snakify.org/lessons/print_input_numbers/ - -+ You may also try step-by-step theory chunks: https://snakify.org/lessons/print_input_numbers/steps/1/ From 62707b5f17d4dc30b15c967237282082e499af9d Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 19:26:55 +0100 Subject: [PATCH 55/59] Update README.es.md --- exercises/008-two_timestamps/README.es.md | 24 ++++++----------------- 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/exercises/008-two_timestamps/README.es.md b/exercises/008-two_timestamps/README.es.md index 009002e9..bd9ff384 100644 --- a/exercises/008-two_timestamps/README.es.md +++ b/exercises/008-two_timestamps/README.es.md @@ -4,28 +4,16 @@ 1. Dadas dos marcas de tiempo del mismo día: un número de horas, minutos y segundos para ambas marcas de tiempo. El momento de la primera marca de tiempo ocurrió antes del momento de la segunda. Calcula cuántos segundos pasaron entre ellas. -## Ejemplo de entrada #1: +## 📎 Ejemplo 1: ```py -two_timestamp(1,1,1,2,2,2) +output = two_timestamp(1,1,1,2,2,2) +print(output) # 3661 ``` -## Ejemplo de salida #1: - -+ 3661 - -## Ejemplo de entrada #2: +## 📎 Ejemplo 2: ```py -two_timestamp(1,2,30,1,3,20) +output = two_timestamp(1,2,30,1,3,20) +print(output) # 50 ``` - -## Ejemplo de salida #2: - -+ 50 - -## 💡 Pistas: - -+ Si no sabes por donde partir este ejercicio por favor, revisa la teoría en esta lección: https://snakify.org/lessons/print_input_numbers/ - -+ También puedes intentar paso a paso con trozos de la teoría: https://snakify.org/lessons/print_input_numbers/steps/1/ \ No newline at end of file From e4e89c3d30aa0277d8c5d5ce068e71f5f695b032 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 19:28:52 +0100 Subject: [PATCH 56/59] Update app.py --- exercises/008-two_timestamps/app.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/exercises/008-two_timestamps/app.py b/exercises/008-two_timestamps/app.py index fda960cc..ae62e597 100644 --- a/exercises/008-two_timestamps/app.py +++ b/exercises/008-two_timestamps/app.py @@ -1,8 +1,7 @@ -#Complete the funtion to compute how many seconds passed between the two timestamp. def two_timestamp(hr1,min1,sec1,hr2,min2,sec2): - + # Your code here return None -#Invoke the fuction and pass two timestamps(6 intergers) as its argument. -print(two_timestamp(1,1,1,2,2,2)) \ No newline at end of file +# Invoke the function and pass two timestamps(6 intergers) as its arguments +print(two_timestamp(1,1,1,2,2,2)) From ef6b111de46b5eeff4fde37287b4c386ab7b689e Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 19:29:15 +0100 Subject: [PATCH 57/59] Update solution.hide.py --- exercises/008-two_timestamps/solution.hide.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/008-two_timestamps/solution.hide.py b/exercises/008-two_timestamps/solution.hide.py index 9c81eba9..8e144bfc 100644 --- a/exercises/008-two_timestamps/solution.hide.py +++ b/exercises/008-two_timestamps/solution.hide.py @@ -1,5 +1,5 @@ -#Complete the funtion to compute how many seconds passed between the two timestamp. def two_timestamp(hr1,min1,sec1,hr2,min2,sec2): + # Your code here fisrt_hour = hr1 * 3600 first_min = min1 * 60 final_first = fisrt_hour + first_min + sec1 @@ -10,5 +10,5 @@ def two_timestamp(hr1,min1,sec1,hr2,min2,sec2): return final_second - final_first -#Invoke the fuction and pass two timestamps(6 intergers) as its argument. -print(two_timestamp(1,1,1,2,2,2)) \ No newline at end of file +# Invoke the function and pass two timestamps(6 intergers) as its arguments +print(two_timestamp(1,1,1,2,2,2)) From 73fb1b7933d8eaf5ed50ec54dc30ac4d8d1fff5b Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 19:31:18 +0100 Subject: [PATCH 58/59] Update solution.hide.py --- exercises/008-two_timestamps/solution.hide.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/exercises/008-two_timestamps/solution.hide.py b/exercises/008-two_timestamps/solution.hide.py index 8e144bfc..88d833bd 100644 --- a/exercises/008-two_timestamps/solution.hide.py +++ b/exercises/008-two_timestamps/solution.hide.py @@ -1,14 +1,13 @@ -def two_timestamp(hr1,min1,sec1,hr2,min2,sec2): +def two_timestamp(hr1, min1, sec1, hr2, min2, sec2): # Your code here - fisrt_hour = hr1 * 3600 + first_hour = hr1 * 3600 first_min = min1 * 60 - final_first = fisrt_hour + first_min + sec1 + final_first = first_hour + first_min + sec1 second_hour = hr2 * 3600 second_min = min2 * 60 final_second = second_hour + second_min + sec2 return final_second - final_first - -# Invoke the function and pass two timestamps(6 intergers) as its arguments -print(two_timestamp(1,1,1,2,2,2)) +# Invoke the function and pass two timestamps(6 integers) as its arguments +print(two_timestamp(1, 1, 1, 2, 2, 2)) From 59558dacc389c33171a2fe9fc0ba2ff75834dc1a Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 19:31:33 +0100 Subject: [PATCH 59/59] Update app.py --- exercises/008-two_timestamps/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/008-two_timestamps/app.py b/exercises/008-two_timestamps/app.py index ae62e597..ab47d89d 100644 --- a/exercises/008-two_timestamps/app.py +++ b/exercises/008-two_timestamps/app.py @@ -1,4 +1,4 @@ -def two_timestamp(hr1,min1,sec1,hr2,min2,sec2): +def two_timestamp(hr1, min1, sec1, hr2, min2, sec2): # Your code here return None