From 63aa235a79021421027690d4e5cb772eb4367536 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 20:55:12 +0100 Subject: [PATCH 01/63] Update README.md --- exercises/009-two_digits/README.md | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/exercises/009-two_digits/README.md b/exercises/009-two_digits/README.md index 6af77973..51d548c7 100644 --- a/exercises/009-two_digits/README.md +++ b/exercises/009-two_digits/README.md @@ -2,20 +2,16 @@ ## 📝 Instructions: -1. Create a function named `two_digits()`. Given a two-digit integer, `two_digits()` returns its left digit (a tens digit) and then its right digit (a ones digit). Use the operator of integer division to obtain the tens digit and the operator of taking remainder to obtain the ones digit. +1. Create a function named `two_digits()`. Given a two-digit integer, `two_digits()` returns its left digit (the tens digit) and then its right digit (the units digit). Use the operator of integer division to obtain the tens digit and the operator of taking remainder to obtain the ones digit. -## Example input: +## 📎 Example input: ```py two_digits(79) ``` -## Example output: +## 📎 Example output: -+ (7, 9) - -## 💡 Hints: - -+ If you don't know how to start solving this assignment, please, review a theory for this lesson: https://snakify.org/lessons/integer_float_numbers/ - -+ You may also try step-by-step theory chunks: https://snakify.org/lessons/integer_float_numbers/steps/1/ \ No newline at end of file +```py +(7, 9) +``` From 146c10d110f9f698e41effa2c53e0ce0c788ca2d Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 20:59:58 +0100 Subject: [PATCH 02/63] Update README.es.md --- exercises/009-two_digits/README.es.md | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/exercises/009-two_digits/README.es.md b/exercises/009-two_digits/README.es.md index badb4e46..f7719147 100644 --- a/exercises/009-two_digits/README.es.md +++ b/exercises/009-two_digits/README.es.md @@ -2,20 +2,16 @@ ## 📝 Instrucciones: -1. Crea una función llamada `two_digits()`. Dado un entero de dos dígitos,`two_digits()` devuelve su dígito izquierdo (las decenas) y luego su dígito derecho (las unidades). Utiliza el operador de división de enteros para obtener el dígito de las decenas y el operador de residuo/resto para obtener el dígito de las unidades. +1. Crea una función llamada `two_digits()`. Dado un entero de dos dígitos, `two_digits()` devuelve su dígito izquierdo (las decenas) y luego su dígito derecho (las unidades). Utiliza el operador de división de enteros para obtener el dígito de las decenas y el operador de residuo/resto para obtener el dígito de las unidades. -## Ejemplo de entrada: +## 📎 Ejemplo de entrada: ```py two_digits(79) ``` -## Ejemplo de salida: +## 📎 Ejemplo de salida: -+ (7, 9) - -## 💡 Pistas: - -+ Si no sabes por donde partir este ejercicio, por favor revisa la teoría en esta lección: https://snakify.org/lessons/integer_float_numbers/ - -+ También puedes intentar paso a paso con trozos de la teoría: https://snakify.org/lessons/integer_float_numbers/steps/1/ \ No newline at end of file +```py +(7, 9) +``` From 7432f9208509d882258f009d739448abee9af0e5 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 21:00:47 +0100 Subject: [PATCH 03/63] Update app.py --- exercises/009-two_digits/app.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/009-two_digits/app.py b/exercises/009-two_digits/app.py index bb47dde0..784bccce 100644 --- a/exercises/009-two_digits/app.py +++ b/exercises/009-two_digits/app.py @@ -1,8 +1,8 @@ -#Complete the function to return the tens digit and the ones digit of any interger. +# Complete the function to return the tens digit and the units digit of any interger def two_digits(digit): + # Your code here return None - -#Invoke the function with any interger as its argument. +# Invoke the function with any two digit integer as its argument print(two_digits(79)) From f158225418afae84ef2518f1f4033cda67701a8d Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 21:01:19 +0100 Subject: [PATCH 04/63] Update app.py --- exercises/009-two_digits/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/009-two_digits/app.py b/exercises/009-two_digits/app.py index 784bccce..a8a424e7 100644 --- a/exercises/009-two_digits/app.py +++ b/exercises/009-two_digits/app.py @@ -1,5 +1,5 @@ # Complete the function to return the tens digit and the units digit of any interger -def two_digits(digit): +def two_digits(number): # Your code here return None From 7cf34266cfab55ed5687799219f997a08f3f70c2 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 21:01:40 +0100 Subject: [PATCH 05/63] Update solution.hide.py --- exercises/009-two_digits/solution.hide.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/exercises/009-two_digits/solution.hide.py b/exercises/009-two_digits/solution.hide.py index 8fdb1e2e..0989eb21 100644 --- a/exercises/009-two_digits/solution.hide.py +++ b/exercises/009-two_digits/solution.hide.py @@ -1,9 +1,9 @@ -#Complete the function to return the tens digit and the ones digit of any interger. -def two_digits(digit): +# Complete the function to return the tens digit and the units digit of any interger +def two_digits(number): + # Your code here aux = str(digit) return (int(aux[0]), int(aux[1])) - -#Invoke the function with any interger as its argument. +# Invoke the function with any two digit integer as its argument print(two_digits(79)) From ab98d4ce793db8e49de6b19dce7a86295e78167a Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 21:06:57 +0100 Subject: [PATCH 06/63] Update solution.hide.py --- exercises/009-two_digits/solution.hide.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/exercises/009-two_digits/solution.hide.py b/exercises/009-two_digits/solution.hide.py index 0989eb21..d6cc2c9d 100644 --- a/exercises/009-two_digits/solution.hide.py +++ b/exercises/009-two_digits/solution.hide.py @@ -1,9 +1,20 @@ # Complete the function to return the tens digit and the units digit of any interger def two_digits(number): - # Your code here - aux = str(digit) - return (int(aux[0]), int(aux[1])) + # Your code here + aux = str(number) + return (int(aux[0]), int(aux[1])) # Invoke the function with any two digit integer as its argument print(two_digits(79)) + + +### SOLUTION 2 ### + +# def two_digits(number): +# tens_digit = number // 10 +# ones_digit = number % 10 + +# return tens_digit, ones_digit + +# print(two_digits(37)) From 25caeadade6ec69e15a1c6c111181e6b10d026ce Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 21:08:44 +0100 Subject: [PATCH 07/63] Update README.md --- exercises/009-two_digits/README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/exercises/009-two_digits/README.md b/exercises/009-two_digits/README.md index 51d548c7..ad76d923 100644 --- a/exercises/009-two_digits/README.md +++ b/exercises/009-two_digits/README.md @@ -2,7 +2,7 @@ ## 📝 Instructions: -1. Create a function named `two_digits()`. Given a two-digit integer, `two_digits()` returns its left digit (the tens digit) and then its right digit (the units digit). Use the operator of integer division to obtain the tens digit and the operator of taking remainder to obtain the ones digit. +1. Create a function named `two_digits()`. Given a two-digit integer, `two_digits()` returns its left digit (the tens digit) and then its right digit (the units digit). ## 📎 Example input: @@ -15,3 +15,7 @@ two_digits(79) ```py (7, 9) ``` + +## 💡 Hint: + ++ Use the operator of integer division `//` to obtain the tens digit and the operator of remainder `%` to obtain the ones digit. From ec5455e47f2362e4ce80100c6db170f3a08ceb3f Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 21:09:57 +0100 Subject: [PATCH 08/63] Update README.es.md --- exercises/009-two_digits/README.es.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/exercises/009-two_digits/README.es.md b/exercises/009-two_digits/README.es.md index f7719147..d66494ff 100644 --- a/exercises/009-two_digits/README.es.md +++ b/exercises/009-two_digits/README.es.md @@ -2,7 +2,7 @@ ## 📝 Instrucciones: -1. Crea una función llamada `two_digits()`. Dado un entero de dos dígitos, `two_digits()` devuelve su dígito izquierdo (las decenas) y luego su dígito derecho (las unidades). Utiliza el operador de división de enteros para obtener el dígito de las decenas y el operador de residuo/resto para obtener el dígito de las unidades. +1. Crea una función llamada `two_digits()`. Dado un entero de dos dígitos, `two_digits()` devuelve su dígito izquierdo (las decenas) y luego su dígito derecho (las unidades). ## 📎 Ejemplo de entrada: @@ -15,3 +15,7 @@ two_digits(79) ```py (7, 9) ``` + +## 💡 Pista: + ++ Utiliza el operador de división de enteros `//` para obtener el dígito de las decenas y el operador de resto `%` para obtener el dígito de las unidades. From e8bbb82fbe977f25eec4151caf1567037dd73b97 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 21:11:03 +0100 Subject: [PATCH 09/63] Update test.py --- exercises/009-two_digits/test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/009-two_digits/test.py b/exercises/009-two_digits/test.py index d75ab637..3f043b98 100644 --- a/exercises/009-two_digits/test.py +++ b/exercises/009-two_digits/test.py @@ -22,7 +22,7 @@ def test_for_file_output(capsys, app): def test_for_file_output(capsys, app): assert app.two_digits(30) == (3,0) -@pytest.mark.it('The function two_digits must return the left and right digits of a 2 digits integer. Testing with 45.') +@pytest.mark.it('The function two_digits must return the left and right digits of a 2 digits integer. Testing with 45') def test_for_file_output(capsys, app): assert app.two_digits(45) == (4,5) From e6b0686bc1383a3239e500443ec31674d6d08e71 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 21:12:49 +0100 Subject: [PATCH 10/63] Update README.md --- exercises/010-swap_digits/README.md | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/exercises/010-swap_digits/README.md b/exercises/010-swap_digits/README.md index ac829f0a..227fde86 100644 --- a/exercises/010-swap_digits/README.md +++ b/exercises/010-swap_digits/README.md @@ -2,24 +2,21 @@ ## 📝 Instructions: -1. Complete a function named `swap_digits()`. Given a two-digit integer, `swap_digits()` swap its digits and prints the result. +1. Complete a function named `swap_digits()`. Given a two-digit integer, `swap_digits()` swaps its digits and print the result. -## Example input: +## 📎 Example input: ```py swap_digits(79) ``` -## Example output: +## 📎 Example output: ```py 97 ``` -## 💡 Hints: - -+ If you don't know how to start solving this assignment, please, review a theory for this lesson: https://snakify.org/lessons/integer_float_numbers/ -+ You can also try step-by-step with theory chunks: https://snakify.org/lessons/integer_float_numbers/steps/1/ +## 💡 Hints: + Note that you need to concatenate two numbers, so you may have to convert them into a string `str(number)`. From 7540b8ba72dd04034680137d4f6b4451e5cf84c6 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 21:14:20 +0100 Subject: [PATCH 11/63] Update app.py --- exercises/010-swap_digits/app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/010-swap_digits/app.py b/exercises/010-swap_digits/app.py index 0024a1bd..9fc7ba9a 100644 --- a/exercises/010-swap_digits/app.py +++ b/exercises/010-swap_digits/app.py @@ -1,7 +1,7 @@ -#Complete the fuction to return the swapped digits of a given two-digit-interger. +# Complete the function to return the swapped digits of a given two-digit integer def swap_digits(num): # Your code here return None -#Invoke the function with any two digit interger as its argument +# Invoke the function with any two-digit integer as its argument print(swap_digits(30)) From d15a5eda523dbc309ec122821edba9b8effc0278 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 21:15:31 +0100 Subject: [PATCH 12/63] Update solution.hide.py --- exercises/010-swap_digits/solution.hide.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/exercises/010-swap_digits/solution.hide.py b/exercises/010-swap_digits/solution.hide.py index 35324ddd..4cbd5f21 100644 --- a/exercises/010-swap_digits/solution.hide.py +++ b/exercises/010-swap_digits/solution.hide.py @@ -1,10 +1,8 @@ -#Complete the fuction to return the swapped digits of a given two-digit-interger. +# Complete the function to return the swapped digits of a given two-digit integer def swap_digits(num): # Your code here - aux = str(num)[1] +str(num)[0] - + aux = str(num)[1] + str(num)[0] return int(aux) - -#Invoke the function with any two digit interger as its argument +# Invoke the function with any two-digit integer as its argument print(swap_digits(30)) From 0620a38c3b23565f1ad4e5a4a90c62f3cb80b4c3 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 21:16:54 +0100 Subject: [PATCH 13/63] Update test.py --- exercises/010-swap_digits/test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/010-swap_digits/test.py b/exercises/010-swap_digits/test.py index 9c9f61ab..07ba1a74 100644 --- a/exercises/010-swap_digits/test.py +++ b/exercises/010-swap_digits/test.py @@ -12,10 +12,10 @@ def test_return_exists(): def test_return_integer(): assert type(app.swap_digits(23)) == type(1) -@pytest.mark.it('The function `swap_digits` must swap the digits. Testing with 79') +@pytest.mark.it('The function swap_digits must swap the digits. Testing with 79') def test_for_file_output(capsys, app): assert app.swap_digits(79) == 97 -@pytest.mark.it('The function `swap_digits` must swap the digits. Testing with 30') +@pytest.mark.it('The function swap_digits must swap the digits. Testing with 30') def test_for_file_output_2(capsys, app): assert app.swap_digits(30) == 3 From e58fb492824bd3f71fe85d59138b97dae3acaaec Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 21:18:05 +0100 Subject: [PATCH 14/63] Update README.es.md --- exercises/010-swap_digits/README.es.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/exercises/010-swap_digits/README.es.md b/exercises/010-swap_digits/README.es.md index c2d66a2a..0e2c0af6 100644 --- a/exercises/010-swap_digits/README.es.md +++ b/exercises/010-swap_digits/README.es.md @@ -4,13 +4,13 @@ 1. Completa una función llamada `swap_digits()`. Dado un número entero de dos dígitos, `swap_digits()` intercambia sus dígitos de posición e imprime el resultado. -## Ejemplo de entrada: +## 📎 Ejemplo de entrada: ```py swap_digits(79) ``` -## Ejemplo de salida: +## 📎 Ejemplo de salida: ```py 97 @@ -18,10 +18,6 @@ swap_digits(79) ## 💡 Pistas: -+ Si no sabes por donde partir este ejercicio, por favor revisa la teoría en esta lección: https://snakify.org/lessons/integer_float_numbers/ - -+ También puedes intentar paso a paso con parte de la teoría: https://snakify.org/lessons/integer_float_numbers/steps/1/ - + Ten en cuenta que para concatenar dos números puedes transformar su valor en un string con la función `str(number)`. + El valor a retornar debe ser un número entero. From 1289d459925768a8771bf678cbdd56b622cef921 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 21:18:59 +0100 Subject: [PATCH 15/63] Update README.md --- exercises/011-last_two_digits/README.md | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/exercises/011-last_two_digits/README.md b/exercises/011-last_two_digits/README.md index e900656d..0e741879 100644 --- a/exercises/011-last_two_digits/README.md +++ b/exercises/011-last_two_digits/README.md @@ -4,20 +4,14 @@ 1. Complete the `last_two_digits()` function. Given an integer greater than `9`, `last_two_digits()` prints its last two digits. -## Example input: +## 📎 Example input: ```py last_two_digits(1234) ``` -## Example output: +## 📎 Example output: ```py 34 ``` - -## 💡 Hints: - -+ If you don't know how to start solving this assignment, please, review a theory for this lesson: https://snakify.org/lessons/integer_float_numbers/ - -+ You may also try step-by-step theory chunks: https://snakify.org/lessons/integer_float_numbers/steps/1/ \ No newline at end of file From 13a71772448ac5787826e7984818db5fa21e0e83 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 21:20:10 +0100 Subject: [PATCH 16/63] Update README.es.md --- exercises/011-last_two_digits/README.es.md | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/exercises/011-last_two_digits/README.es.md b/exercises/011-last_two_digits/README.es.md index 0565724b..a030c6cf 100644 --- a/exercises/011-last_two_digits/README.es.md +++ b/exercises/011-last_two_digits/README.es.md @@ -2,21 +2,16 @@ ## 📝 Instrucciones: -1. Completa la función `last_two_digits()` para que dado un número entero mayor que `9`, imprima sus últimos dos dígitos. +1. Completa la función `last_two_digits()` para que, dado un número entero mayor que `9`, imprima sus últimos dos dígitos. -## Ejemplo de entrada: +## 📎 Ejemplo de entrada: ```py last_two_digits(1234) ``` -## Ejemplo de salida: +## 📎 Ejemplo de salida: ```py 34 ``` -## 💡 Pistas: - -+ Si no sabes por donde comenzar este ejercicio, por favor, revisa la teoría en esta lección: https://snakify.org/lessons/integer_float_numbers/ - -+ También puedes intentar paso a paso con trozos de la teoría: https://snakify.org/lessons/integer_float_numbers/steps/1/ \ No newline at end of file From 20953353f2ec225459cb12a2d47a551dddb3f36c Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 21:20:59 +0100 Subject: [PATCH 17/63] Update app.py --- exercises/011-last_two_digits/app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/011-last_two_digits/app.py b/exercises/011-last_two_digits/app.py index 42436057..cf00ec28 100644 --- a/exercises/011-last_two_digits/app.py +++ b/exercises/011-last_two_digits/app.py @@ -1,6 +1,6 @@ -#Complete the function to print the last two digits of an interger greater than 9. +# Complete the function to print the last two digits of an integer greater than 9 def last_two_digits(num): return None -#Invoke the function with any interger greater than 9. +# Invoke the function with any integer greater than 9 print(last_two_digits()) From f4d06cd8fd9f463aebdf0637ec79b7f3f450788a Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 21:26:16 +0100 Subject: [PATCH 18/63] Update solution.hide.py --- exercises/011-last_two_digits/solution.hide.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/exercises/011-last_two_digits/solution.hide.py b/exercises/011-last_two_digits/solution.hide.py index 8b58b249..9963be0b 100644 --- a/exercises/011-last_two_digits/solution.hide.py +++ b/exercises/011-last_two_digits/solution.hide.py @@ -1,8 +1,7 @@ -#Complete the function to print the last two digits of an interger greater than 9. +# Complete the function to print the last two digits of an integer greater than 9 def last_two_digits(num): if num > 9: return int(str(num)[-2:]) else: return num - -#Invoke the function with any interger greater than 9. -print(last_two_digits(1222)) +# Invoke the function with any integer greater than 9 +print(last_two_digits()) From 750e68d208029aab9d5de25d96c463250ae26643 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 21:26:49 +0100 Subject: [PATCH 19/63] Update test.py --- exercises/011-last_two_digits/test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/011-last_two_digits/test.py b/exercises/011-last_two_digits/test.py index 9159925a..914d629e 100644 --- a/exercises/011-last_two_digits/test.py +++ b/exercises/011-last_two_digits/test.py @@ -12,7 +12,7 @@ def test_for_return(capsys, app): def test_for_output_type(capsys, app): assert type(app.last_two_digits(30)) == type(1) -@pytest.mark.it('The function last_two_digits must return only the last 2 digits of a integer greater than 9') +@pytest.mark.it('The function last_two_digits must return only the last 2 digits of an integer greater than 9') def test_for_file_output(capsys, app): if app.last_two_digits(30) > 9: assert app.last_two_digits(30) == int(str(30)[-2:]) From e933227912d3b8473139ce3f67d47d994283082b Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 21:32:25 +0100 Subject: [PATCH 20/63] Update README.md --- exercises/012-tens_digit/README.md | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/exercises/012-tens_digit/README.md b/exercises/012-tens_digit/README.md index 03a85a12..70883df6 100644 --- a/exercises/012-tens_digit/README.md +++ b/exercises/012-tens_digit/README.md @@ -4,32 +4,16 @@ 1. Complete the `tens_digit()` function. Given an integer, `tens_digit()` returns its tens digit. -## Example input 1: +## 📎 Example 1: ```py -tens_digit(1234) +output = tens_digit(1234) +print(output) # 3 ``` -## Example output 1: +## 📎 Example 2: ```py -3 +output = tens_digit(179) +print(output) # 7 ``` - -## Example input 2: - -```py -tens_digit(179) -``` - -## Example output 2: - -```py -7 -``` - -## 💡 Hints: - -+ If you don't know how to start solving this assignment, please, review a theory for this lesson: https://snakify.org/lessons/integer_float_numbers/ - -+ You may also try step-by-step theory chunks: https://snakify.org/lessons/integer_float_numbers/steps/1/ From 4056581cd982306eff564b1280eceaaa4e4a21e0 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 21:35:37 +0100 Subject: [PATCH 21/63] Update README.md --- exercises/010-swap_digits/README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/exercises/010-swap_digits/README.md b/exercises/010-swap_digits/README.md index 227fde86..4a518284 100644 --- a/exercises/010-swap_digits/README.md +++ b/exercises/010-swap_digits/README.md @@ -18,6 +18,10 @@ swap_digits(79) ## 💡 Hints: ++ If you don't know how to start solving this assignment, please review the theory for this lesson: https://snakify.org/lessons/integer_float_numbers/ + ++ You can also try step-by-step with theory chunks: https://snakify.org/lessons/integer_float_numbers/steps/1/ + + Note that you need to concatenate two numbers, so you may have to convert them into a string `str(number)`. + The function must return an integer. From 6e20ab5f5881d66519ce91989ed004d618699578 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 21:36:20 +0100 Subject: [PATCH 22/63] Update README.es.md --- exercises/010-swap_digits/README.es.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/exercises/010-swap_digits/README.es.md b/exercises/010-swap_digits/README.es.md index 0e2c0af6..3a3c60f3 100644 --- a/exercises/010-swap_digits/README.es.md +++ b/exercises/010-swap_digits/README.es.md @@ -18,6 +18,10 @@ swap_digits(79) ## 💡 Pistas: ++ Si no sabes por donde empezar este ejercicio, por favor revisa la teoría en esta lección: https://snakify.org/lessons/integer_float_numbers/ + ++ También puedes intentar paso a paso con parte de la teoría: https://snakify.org/lessons/integer_float_numbers/steps/1/ + + Ten en cuenta que para concatenar dos números puedes transformar su valor en un string con la función `str(number)`. + El valor a retornar debe ser un número entero. From 5f3a05ddc093f882daec6110dea8781307732547 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 21:41:19 +0100 Subject: [PATCH 23/63] Update README.es.md --- exercises/011-last_two_digits/README.es.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/exercises/011-last_two_digits/README.es.md b/exercises/011-last_two_digits/README.es.md index a030c6cf..c18d0587 100644 --- a/exercises/011-last_two_digits/README.es.md +++ b/exercises/011-last_two_digits/README.es.md @@ -15,3 +15,9 @@ last_two_digits(1234) ```py 34 ``` + +## 💡 Pistas: + ++ Si no sabes por donde comenzar este ejercicio, por favor, revisa la teoría en esta lección: https://snakify.org/lessons/integer_float_numbers/ + ++ También puedes intentar paso a paso con trozos de la teoría: https://snakify.org/lessons/integer_float_numbers/steps/1/ From 61c53eb491d830715102fb5f6f6b468375a4e046 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 21:41:53 +0100 Subject: [PATCH 24/63] Update README.md --- exercises/011-last_two_digits/README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/exercises/011-last_two_digits/README.md b/exercises/011-last_two_digits/README.md index 0e741879..ae92ca81 100644 --- a/exercises/011-last_two_digits/README.md +++ b/exercises/011-last_two_digits/README.md @@ -15,3 +15,9 @@ last_two_digits(1234) ```py 34 ``` + +## 💡 Hints: + ++ If you don't know how to start solving this assignment, please review the theory for this lesson: https://snakify.org/lessons/integer_float_numbers/ + ++ You may also try step-by-step theory chunks: https://snakify.org/lessons/integer_float_numbers/steps/1/ From b4f7ef1048e1d2a2f66ee343d2f09b085677992d Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 21:42:21 +0100 Subject: [PATCH 25/63] Update README.md --- exercises/012-tens_digit/README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/exercises/012-tens_digit/README.md b/exercises/012-tens_digit/README.md index 70883df6..ec0e6f4d 100644 --- a/exercises/012-tens_digit/README.md +++ b/exercises/012-tens_digit/README.md @@ -17,3 +17,9 @@ print(output) # 3 output = tens_digit(179) print(output) # 7 ``` + +## 💡 Hints: + ++ If you don't know how to start solving this assignment, please, review a theory for this lesson: https://snakify.org/lessons/integer_float_numbers/ + ++ You may also try step-by-step theory chunks: https://snakify.org/lessons/integer_float_numbers/steps/1/ From 3e4c53d04e6fa06eaa619495324505f3817d631c Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 21:42:32 +0100 Subject: [PATCH 26/63] Update README.md --- exercises/012-tens_digit/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/012-tens_digit/README.md b/exercises/012-tens_digit/README.md index ec0e6f4d..661c8dae 100644 --- a/exercises/012-tens_digit/README.md +++ b/exercises/012-tens_digit/README.md @@ -20,6 +20,6 @@ print(output) # 7 ## 💡 Hints: -+ If you don't know how to start solving this assignment, please, review a theory for this lesson: https://snakify.org/lessons/integer_float_numbers/ ++ If you don't know how to start solving this assignment, please review the theory for this lesson: https://snakify.org/lessons/integer_float_numbers/ + You may also try step-by-step theory chunks: https://snakify.org/lessons/integer_float_numbers/steps/1/ From ce0deba6a3034db1f31cd9d22b6352e119f8eec7 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 21:47:44 +0100 Subject: [PATCH 27/63] Update README.es.md --- exercises/012-tens_digit/README.es.md | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/exercises/012-tens_digit/README.es.md b/exercises/012-tens_digit/README.es.md index cebc1588..0fb637ae 100644 --- a/exercises/012-tens_digit/README.es.md +++ b/exercises/012-tens_digit/README.es.md @@ -4,28 +4,18 @@ 1. Completa la función `tens_digit()` para que dado un número entero, retorne sus decenas. -## Ejemplo de entrada 1: +## 📎 Ejemplo 1: ```py -tens_digit(1234) +output = tens_digit(1234) +print(output) # 3 ``` -## Ejemplo de salida 1: +## 📎 Ejemplo 2: ```py -3 -``` - -## Ejemplo de entrada 2: - -```py -tens_digit(179) -``` - -## Ejemplo de salida 2: - -```py -7 +output = tens_digit(179) +print(output) # 7 ``` ## 💡 Pistas: From 37380cc18b659ba3f813ccccc81318ef4f913756 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 21:47:52 +0100 Subject: [PATCH 28/63] Update README.es.md --- exercises/012-tens_digit/README.es.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/012-tens_digit/README.es.md b/exercises/012-tens_digit/README.es.md index 0fb637ae..8a062390 100644 --- a/exercises/012-tens_digit/README.es.md +++ b/exercises/012-tens_digit/README.es.md @@ -4,7 +4,7 @@ 1. Completa la función `tens_digit()` para que dado un número entero, retorne sus decenas. -## 📎 Ejemplo 1: +## 📎 Ejemplo 1: ```py output = tens_digit(1234) From bc8f68fe5ba8901126c6be5c2594b551adcf2609 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 21:48:59 +0100 Subject: [PATCH 29/63] Update app.py --- exercises/012-tens_digit/app.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/exercises/012-tens_digit/app.py b/exercises/012-tens_digit/app.py index bf6ee8f4..467c2902 100644 --- a/exercises/012-tens_digit/app.py +++ b/exercises/012-tens_digit/app.py @@ -1,9 +1,7 @@ -#Complete the function to return the tens digit of a given interger +# Complete the function to return the tens digit of a given integer def tens_digit(num): return None - - -#Invoke the function with any interger. -print(tens_digit()) \ No newline at end of file +# Invoke the function with any integer +print(tens_digit()) From 20360fba95dad2cfd96724cecd77515cf579f139 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 21:49:27 +0100 Subject: [PATCH 30/63] Update solution.hide.py --- exercises/012-tens_digit/solution.hide.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/exercises/012-tens_digit/solution.hide.py b/exercises/012-tens_digit/solution.hide.py index d53a9b3c..6a9bec72 100644 --- a/exercises/012-tens_digit/solution.hide.py +++ b/exercises/012-tens_digit/solution.hide.py @@ -1,9 +1,7 @@ -#Complete the function to return the tens digit of a given interger +# Complete the function to return the tens digit of a given integer def tens_digit(num): return (num // 10) % 10 - - -#Invoke the function with any interger. -print(tens_digit(123)) \ No newline at end of file +# Invoke the function with any integer +print(tens_digit()) From c6c37b90da4ab6412b7ecf5e0e1428df0e8b30ee Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 21:50:49 +0100 Subject: [PATCH 31/63] Update test.py --- exercises/012-tens_digit/test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/012-tens_digit/test.py b/exercises/012-tens_digit/test.py index 8d17f179..5d801a3f 100644 --- a/exercises/012-tens_digit/test.py +++ b/exercises/012-tens_digit/test.py @@ -12,7 +12,7 @@ def test_for_return(capsys, app): def test_for_output_type(capsys, app): assert type(app.tens_digit(123)) == type(1) -@pytest.mark.it('We tried to pass 854345 as parameter and it did not return 4!') +@pytest.mark.it('We tried to pass 854345 as parameter and it did not return 4') def test_for_file_output(capsys, app): assert app.tens_digit(854345) == (854345 // 10)%10 From 10b8d889791e343e5998a3e5d5b0b8b37ee8dc4e Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 21:54:39 +0100 Subject: [PATCH 32/63] Update solution.hide.py --- exercises/011-last_two_digits/solution.hide.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/011-last_two_digits/solution.hide.py b/exercises/011-last_two_digits/solution.hide.py index 9963be0b..523e2b01 100644 --- a/exercises/011-last_two_digits/solution.hide.py +++ b/exercises/011-last_two_digits/solution.hide.py @@ -4,4 +4,4 @@ def last_two_digits(num): else: return num # Invoke the function with any integer greater than 9 -print(last_two_digits()) +print(last_two_digits(212)) From 0c019c1913f956c9a28756d2adf73ebee6e4bca6 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Tue, 12 Dec 2023 21:55:03 +0100 Subject: [PATCH 33/63] Update solution.hide.py --- exercises/012-tens_digit/solution.hide.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/012-tens_digit/solution.hide.py b/exercises/012-tens_digit/solution.hide.py index 6a9bec72..4835a34d 100644 --- a/exercises/012-tens_digit/solution.hide.py +++ b/exercises/012-tens_digit/solution.hide.py @@ -4,4 +4,4 @@ def tens_digit(num): # Invoke the function with any integer -print(tens_digit()) +print(tens_digit(198)) From c18d528cbc33918555642522eca35573f028cf4a Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 00:42:35 +0100 Subject: [PATCH 34/63] Update README.md --- exercises/013-sum_of_digits/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/exercises/013-sum_of_digits/README.md b/exercises/013-sum_of_digits/README.md index fa87c902..1123a484 100644 --- a/exercises/013-sum_of_digits/README.md +++ b/exercises/013-sum_of_digits/README.md @@ -4,13 +4,13 @@ 1. Complete the `digits_sum()` function. Given a three-digit number, `digits_sum()` finds the sum of its digits. -## Example input: +## 📎 Example input: ```py digits_sum(123) ``` -## Example output: +## 📎 Example output: ```py 6 @@ -18,6 +18,6 @@ digits_sum(123) ## 💡 Hints: -+ If you don't know how to start solving this assignment, please, review a theory for this lesson: https://snakify.org/lessons/integer_float_numbers/ ++ If you don't know how to start solving this assignment, please review the theory for this lesson: https://snakify.org/lessons/integer_float_numbers/ -+ You may also try step-by-step theory chunks: https://snakify.org/lessons/integer_float_numbers/steps/1/ \ No newline at end of file ++ You may also try step-by-step theory chunks: https://snakify.org/lessons/integer_float_numbers/steps/1/ From 53ac90c3bdb6d7e74219a658dbdf17c681b9b751 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 00:43:18 +0100 Subject: [PATCH 35/63] Update README.es.md --- exercises/013-sum_of_digits/README.es.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/013-sum_of_digits/README.es.md b/exercises/013-sum_of_digits/README.es.md index 91c3de9a..f9dd90f4 100644 --- a/exercises/013-sum_of_digits/README.es.md +++ b/exercises/013-sum_of_digits/README.es.md @@ -4,13 +4,13 @@ 1. Completa la función `digits_sum()` para que dado un número de tres dígitos, retorne la suma de sus dígitos. -## Ejemplo de entrada: +## 📎 Ejemplo de entrada: ```py digits_sum(123) ``` -## Ejemplo de salida: +## 📎 Ejemplo de salida: ```py 6 @@ -20,4 +20,4 @@ + Si no sabes por donde comenzar este ejercicio, por favor, revisa la teoría en esta lección: https://snakify.org/lessons/integer_float_numbers/ -+ También puedes intentar paso a paso con trozos de la teoría: https://snakify.org/lessons/integer_float_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/integer_float_numbers/steps/1/ From 523768c5bd61846b56a425fd772e671597bf284f Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 00:44:02 +0100 Subject: [PATCH 36/63] Update app.py --- exercises/013-sum_of_digits/app.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/exercises/013-sum_of_digits/app.py b/exercises/013-sum_of_digits/app.py index a9497cb1..502dff35 100644 --- a/exercises/013-sum_of_digits/app.py +++ b/exercises/013-sum_of_digits/app.py @@ -1,8 +1,7 @@ -#Complete the function "digits_sum" so that it prints the sum of a three digit number. +# Complete the function "digits_sum" so that it prints the sum of a three-digit number def digits_sum(num): return None -#Invoke the function with any three-digit-number -#You can try other three-digit numbers if you want -print(digits_sum(123)) \ No newline at end of file +# Invoke the function with any three-digit number +print(digits_sum(123)) From 4faba1a7d3f23e1d3da85eb1d743c97c5c0dfab2 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 00:45:53 +0100 Subject: [PATCH 37/63] Update solution.hide.py --- exercises/013-sum_of_digits/solution.hide.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/exercises/013-sum_of_digits/solution.hide.py b/exercises/013-sum_of_digits/solution.hide.py index b7f902de..82eeb761 100644 --- a/exercises/013-sum_of_digits/solution.hide.py +++ b/exercises/013-sum_of_digits/solution.hide.py @@ -1,11 +1,10 @@ -#Complete the function "digits_sum" so that it prints the sum of a three digit number. +# Complete the function "digits_sum" so that it prints the sum of a three-digit number def digits_sum(num): aux = 0 for x in str(num): - aux= aux+int(x) + aux = aux + int(x) return aux -#Invoke the function with any three-digit-number -#You can try other three-digit numbers if you want -print(digits_sum(123)) \ No newline at end of file +# Invoke the function with any three-digit number +print(digits_sum(123)) From 66eeb43e9331a41b7c32322a09147d2532a50e41 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 00:46:44 +0100 Subject: [PATCH 38/63] Update test.py --- exercises/013-sum_of_digits/test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/013-sum_of_digits/test.py b/exercises/013-sum_of_digits/test.py index f6044d0a..8e5019f2 100644 --- a/exercises/013-sum_of_digits/test.py +++ b/exercises/013-sum_of_digits/test.py @@ -12,7 +12,7 @@ def test_for_return(capsys, app): def test_for_output_type(capsys, app): assert type(app.digits_sum(123)) == type(1) -@pytest.mark.it('We tried to pass 854 as parameter and it did not return 17!') +@pytest.mark.it('We tried to pass 854 as parameter and it did not return 17') def test_for_file_output(capsys, app): assert app.digits_sum(854) == (854 //100)+(854 // 10)%10+ 854%10 From 30c7906fff413263c3414c96cafd8b8a561496fc Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 00:48:35 +0100 Subject: [PATCH 39/63] Update README.md --- exercises/014-digit_after_decimal_point/README.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/exercises/014-digit_after_decimal_point/README.md b/exercises/014-digit_after_decimal_point/README.md index 605c05ab..df031da4 100644 --- a/exercises/014-digit_after_decimal_point/README.md +++ b/exercises/014-digit_after_decimal_point/README.md @@ -4,18 +4,20 @@ 1. Complete the `first_digit()` function. Given a positive real number, `first_digit()` returns its first digit (to the right of the decimal point). -## Example input: +## 📎 Example input: ```py first_digit(1.79) ``` -## Example output: +## 📎 Example output: -+ 7 +```py +7 +``` ## 💡 Hints: -+ If you don't know how to start solving this assignment, please, review a theory for this lesson: https://snakify.org/lessons/integer_float_numbers/ ++ If you don't know how to start solving this assignment, please review the theory for this lesson: https://snakify.org/lessons/integer_float_numbers/ -+ You may also try step-by-step theory chunks: https://snakify.org/lessons/integer_float_numbers/steps/1/ \ No newline at end of file ++ You may also try step-by-step theory chunks: https://snakify.org/lessons/integer_float_numbers/steps/1/ From 0e57b0d4b1fac99379809ff9bdf8e5663a71024f Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 00:51:10 +0100 Subject: [PATCH 40/63] Update README.es.md --- exercises/014-digit_after_decimal_point/README.es.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/exercises/014-digit_after_decimal_point/README.es.md b/exercises/014-digit_after_decimal_point/README.es.md index edb48536..4dd84653 100644 --- a/exercises/014-digit_after_decimal_point/README.es.md +++ b/exercises/014-digit_after_decimal_point/README.es.md @@ -4,18 +4,20 @@ 1. Completa la función `first_digit()` para que dado un número real positivo, devuelve su primer decimal (a la derecha del punto). -## Ejemplo de entrada: +## 📎 Ejemplo de entrada: ```py first_digit(1.79) ``` -## Ejemplo de salida: +## 📎 Ejemplo de salida: -+ 7 +``` +7 +``` ## 💡 Pistas: + Si no sabes por donde comenzar este ejercicio, por favor, revisa la teoría en esta lección: https://snakify.org/lessons/integer_float_numbers/ -+ También puedes intentar paso a paso con trozos de la teoría: https://snakify.org/lessons/integer_float_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/integer_float_numbers/steps/1/ From 94244bbf1cb43b93a62cc4fd24715f4aea894152 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 00:52:09 +0100 Subject: [PATCH 41/63] Update app.py --- exercises/014-digit_after_decimal_point/app.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/exercises/014-digit_after_decimal_point/app.py b/exercises/014-digit_after_decimal_point/app.py index 34dd6b96..01940696 100644 --- a/exercises/014-digit_after_decimal_point/app.py +++ b/exercises/014-digit_after_decimal_point/app.py @@ -1,8 +1,7 @@ -#Complete the function to return the first digit to the right of the decimal point. +# Complete the function to return the first digit to the right of the decimal point def first_digit(num): return None - -#Invoke the function with a positive real number. ex. 34.33 -print(first_digit()) \ No newline at end of file +# Invoke the function with a positive real number. ex. 34.33 +print(first_digit()) From 7285b7639f1c6de44243e7066c6d066719aef9f0 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 00:53:21 +0100 Subject: [PATCH 42/63] Update solution.hide.py --- exercises/014-digit_after_decimal_point/solution.hide.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/exercises/014-digit_after_decimal_point/solution.hide.py b/exercises/014-digit_after_decimal_point/solution.hide.py index 18551586..fa32a9a8 100644 --- a/exercises/014-digit_after_decimal_point/solution.hide.py +++ b/exercises/014-digit_after_decimal_point/solution.hide.py @@ -1,10 +1,9 @@ -#Complete the function to return the first digit to the right of the decimal point. import math + +# Complete the function to return the first digit to the right of the decimal point def first_digit(num): return int(str(math.floor(num*10)/10)[-1]) - - -#Invoke the function with a positive real number. ex. 34.33 -print(first_digit(2.6)) \ No newline at end of file +# Invoke the function with a positive real number. ex. 34.33 +print(first_digit(2.6)) From b4a206918be139006467154d70ab76a912eae270 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 00:56:47 +0100 Subject: [PATCH 43/63] Update test.py --- exercises/014-digit_after_decimal_point/test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/014-digit_after_decimal_point/test.py b/exercises/014-digit_after_decimal_point/test.py index cfd402a9..b6486721 100644 --- a/exercises/014-digit_after_decimal_point/test.py +++ b/exercises/014-digit_after_decimal_point/test.py @@ -1,6 +1,6 @@ import io, sys, pytest, os, re, mock -@pytest.mark.it('The function first_digits must exist') +@pytest.mark.it('The function first_digit must exist') def test_for_functon_existence(capsys, app): assert callable(app.first_digit) @@ -12,7 +12,7 @@ def test_for_return(capsys, app): def test_for_output_type(capsys, app): assert type(app.first_digit(1.2)) == type(1) -@pytest.mark.it('We tried to pass 6.24 as parameter and it did not return 2!') +@pytest.mark.it('We tried to pass 6.24 as parameter and it did not return 2') def test_for_file_output(capsys, app): assert app.first_digit(6.24) == int(6.24 *10)%10 From 2adc3753bb025b2ac9a82de310cef32b48179d36 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 01:04:31 +0100 Subject: [PATCH 44/63] Update README.md --- exercises/015-car_route/README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/exercises/015-car_route/README.md b/exercises/015-car_route/README.md index 9cd79eb2..09cd596f 100644 --- a/exercises/015-car_route/README.md +++ b/exercises/015-car_route/README.md @@ -1,20 +1,22 @@ # `015` car route -A car can cover distance of `N` kilometers per day. How many days will it take to cover a route of length `M` kilometers? +A car can cover a distance of `N` kilometers per day. How many days will it take to cover a route of length `M` kilometers? ## 📝 Instructions: -1. Write a `car_route()` function that given the distance it can drive in one day as the first parameter, and the distance to drive as the second parameter, calculates the number of days it will take to drive that distance. +1. Write a `car_route()` function that, given the distance it can drive in one day as the first parameter, and the distance to drive as the second parameter, calculates the number of days it will take to drive that distance. -## Example input: +## 📎 Example input: ```py car_route(20,40) ``` -## Example output: +## 📎 Example output: +```py 2 +``` ## 💡 Hints: From 0cfa61ff8af0f0e05e752e0005d3c847c2efba21 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 01:04:42 +0100 Subject: [PATCH 45/63] Update README.md --- exercises/015-car_route/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/015-car_route/README.md b/exercises/015-car_route/README.md index 09cd596f..1951a50f 100644 --- a/exercises/015-car_route/README.md +++ b/exercises/015-car_route/README.md @@ -24,6 +24,6 @@ car_route(20,40) + You must round up the outcome if you get a float, for example, if it takes you 1.1 days to travel the distance, it must return 2. -+ If you don't know how to start solving this assignment, please, review a theory for this lesson: https://snakify.org/lessons/integer_float_numbers/ ++ If you don't know how to start solving this assignment, please review the theory for this lesson: https://snakify.org/lessons/integer_float_numbers/ + You may also try step-by-step theory chunks: https://snakify.org/lessons/integer_float_numbers/steps/1/ From 1f60e25d3eae6cb65f04a36aa22e935cb2b8c4bd Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 01:06:47 +0100 Subject: [PATCH 46/63] Update README.es.md --- exercises/015-car_route/README.es.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/exercises/015-car_route/README.es.md b/exercises/015-car_route/README.es.md index cbb3e0de..33f17331 100644 --- a/exercises/015-car_route/README.es.md +++ b/exercises/015-car_route/README.es.md @@ -4,24 +4,26 @@ Un vehículo puede cubrir una distancia de `N` kilómetros por día ¿Cuántos d ## 📝 Instrucciones: -1. Escribe una función `car_route()` que dada la distancia que puede recorrer en un dia como primer parametro, y como segundo parametro la distancia a recorrer, calcule la cantidad de dias que le tomara recorrer dicha distancia. +1. Escribe una función `car_route()` que dada la distancia que puede recorrer en un día como primer parametro, y como segundo parametro la distancia a recorrer, calcule la cantidad de dias que le tomara recorrer dicha distancia. -## Ejemplo de entrada: +## 📎 Ejemplo de entrada: ```py -car_route(20,40) +car_route(20, 40) ``` -## Ejemplo de salida: +## 📎 Ejemplo de salida: -+ 2 +```py +2 +``` ## 💡 Pistas: + El programa recibe dos números: `N` y `M`. -+ Debes redondear el resultado hacia arriba si obtienes un decimal, es decir si te toma 1.1 dias recorrer la distancia, debe retornar 2. ++ Debes redondear el resultado hacia arriba si obtienes un decimal, es decir, si te toma 1.1 días recorrer la distancia, debe retornar 2. + Si no sabes por donde comenzar este ejercicio, por favor, revisa la teoría en esta lección: https://snakify.org/lessons/integer_float_numbers/ -+ También puedes intentar paso a paso con trozos de la teoría: https://snakify.org/lessons/integer_float_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/integer_float_numbers/steps/1/ From d65b9df8211a6586850ca3abb32de423ba50ffe7 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 01:06:52 +0100 Subject: [PATCH 47/63] Update README.md --- exercises/015-car_route/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/015-car_route/README.md b/exercises/015-car_route/README.md index 1951a50f..21a79745 100644 --- a/exercises/015-car_route/README.md +++ b/exercises/015-car_route/README.md @@ -9,7 +9,7 @@ A car can cover a distance of `N` kilometers per day. How many days will it take ## 📎 Example input: ```py -car_route(20,40) +car_route(20, 40) ``` ## 📎 Example output: From 163cc9196b7204d8e5529390abd1207677c8060b Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 01:07:34 +0100 Subject: [PATCH 48/63] Update README.es.md --- exercises/015-car_route/README.es.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/015-car_route/README.es.md b/exercises/015-car_route/README.es.md index 33f17331..69837c77 100644 --- a/exercises/015-car_route/README.es.md +++ b/exercises/015-car_route/README.es.md @@ -4,7 +4,7 @@ Un vehículo puede cubrir una distancia de `N` kilómetros por día ¿Cuántos d ## 📝 Instrucciones: -1. Escribe una función `car_route()` que dada la distancia que puede recorrer en un día como primer parametro, y como segundo parametro la distancia a recorrer, calcule la cantidad de dias que le tomara recorrer dicha distancia. +1. Escribe una función `car_route()` que dada la distancia que puede recorrer en un día como primer parámetro, y como segundo parámetro la distancia a recorrer, calcule la cantidad de días que le tomara recorrer dicha distancia. ## 📎 Ejemplo de entrada: From 5a059c4b5a9c77a7a60ab2c141bae1a5f66a5350 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 01:08:21 +0100 Subject: [PATCH 49/63] Update README.md --- exercises/015-car_route/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/exercises/015-car_route/README.md b/exercises/015-car_route/README.md index 21a79745..efda322b 100644 --- a/exercises/015-car_route/README.md +++ b/exercises/015-car_route/README.md @@ -24,6 +24,8 @@ car_route(20, 40) + You must round up the outcome if you get a float, for example, if it takes you 1.1 days to travel the distance, it must return 2. ++ You may need to import the `math` module for this exercise. + + If you don't know how to start solving this assignment, please review the theory for this lesson: https://snakify.org/lessons/integer_float_numbers/ + You may also try step-by-step theory chunks: https://snakify.org/lessons/integer_float_numbers/steps/1/ From c315c3aa893655cf1a4ad7dfa0970f981a7a53d6 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 01:08:50 +0100 Subject: [PATCH 50/63] Update README.es.md --- exercises/015-car_route/README.es.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/exercises/015-car_route/README.es.md b/exercises/015-car_route/README.es.md index 69837c77..14965499 100644 --- a/exercises/015-car_route/README.es.md +++ b/exercises/015-car_route/README.es.md @@ -24,6 +24,8 @@ car_route(20, 40) + Debes redondear el resultado hacia arriba si obtienes un decimal, es decir, si te toma 1.1 días recorrer la distancia, debe retornar 2. ++ Sería buena idea que importaras el módulo `math` para este ejercicio. + + Si no sabes por donde comenzar este ejercicio, por favor, revisa la teoría en esta lección: https://snakify.org/lessons/integer_float_numbers/ + También puedes intentar paso a paso con trozos de la teoría: https://snakify.org/lessons/integer_float_numbers/steps/1/ From f50f10dc69cc9baf0e25e00ca05cf699e27498df Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 01:09:46 +0100 Subject: [PATCH 51/63] Update app.py --- exercises/015-car_route/app.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/exercises/015-car_route/app.py b/exercises/015-car_route/app.py index 4bd4bae7..909df947 100644 --- a/exercises/015-car_route/app.py +++ b/exercises/015-car_route/app.py @@ -1,9 +1,7 @@ -#Complete the function to return the amount of days it will take to cover a route. -#HINT: You may need to import the math module for this exercise. - +# Complete the function to return the amount of days it will take to cover a route def car_route(n,m): return None -#Invoke the function with two intergers. -print(car_route()) \ No newline at end of file +# Invoke the function with two integers +print(car_route()) From bfef736099449294ee369ca7dd1faa4680cd91e1 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 01:11:39 +0100 Subject: [PATCH 52/63] Update solution.hide.py --- exercises/015-car_route/solution.hide.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/exercises/015-car_route/solution.hide.py b/exercises/015-car_route/solution.hide.py index 4c8450a9..5be8fffc 100644 --- a/exercises/015-car_route/solution.hide.py +++ b/exercises/015-car_route/solution.hide.py @@ -1,9 +1,9 @@ -#Complete the function to return the amount of days it will take to cover a route. -#HINT: You may need to import the math module for this exercise. import math + +# Complete the function to return the amount of days it will take to cover a route def car_route(n,m): return int(math.ceil(m/n)) -#Invoke the function with two intergers. -print(car_route()) \ No newline at end of file +# Invoke the function with two integers +print(car_route(35, 50)) From 72182ca016f1e4d9b1d94b1ada71a20ba5da699a Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 01:12:56 +0100 Subject: [PATCH 53/63] Update test.py --- exercises/015-car_route/test.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/015-car_route/test.py b/exercises/015-car_route/test.py index e4f5c309..d248865a 100644 --- a/exercises/015-car_route/test.py +++ b/exercises/015-car_route/test.py @@ -12,7 +12,7 @@ def test_import_random(): def test_for_functon_existence(capsys, app): assert callable(app.car_route) -@pytest.mark.it('The function mus return something') +@pytest.mark.it('The function must return something') def test_function_return(capsys, app): assert app.car_route(659, 1857) != None @@ -20,11 +20,11 @@ def test_function_return(capsys, app): def test_function_return_type(capsys, app): assert type(app.car_route(659, 1857)) == type(1) -@pytest.mark.it('We tried to pass 20 and 40 as parameter and it did not return 2!') +@pytest.mark.it('We tried to pass 20 and 40 as parameter and it did not return 2') def test_for_file_output(capsys, app): assert app.car_route(20, 40) == 2 -@pytest.mark.it('We tried to pass 20 and 900 as parameter and it did not return 45!') +@pytest.mark.it('We tried to pass 20 and 900 as parameter and it did not return 45') def test_for_file_output2(capsys, app): assert app.car_route(20, 900) == 45 From 60842b167bcd213c1b515a8bfe3a8209cceaecb9 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 01:16:24 +0100 Subject: [PATCH 54/63] Update README.md --- exercises/016-century/README.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/exercises/016-century/README.md b/exercises/016-century/README.md index faf2553f..e56775e1 100644 --- a/exercises/016-century/README.md +++ b/exercises/016-century/README.md @@ -2,22 +2,24 @@ ## 📝 Instructions: -1. Write a function `century()`. Given a year (as a positive integer), `century()` finds the respective number of the century. +1. Write a function `century()`. Given a year (as a positive integer), `century()` finds the respective number of the century. -## Example input: +## 📎 Example input: ```py century(2001) ``` -## Example output: +## 📎Example output: -+ 21 +```py +21 +``` ## 💡 Hints: -+ Note that, for example, 20th century began with the year 1901. ++ Note that, for example, the 20th century began with the year 1901. -+ If you don't know how to start solving this assignment, please, review a theory for this lesson: https://snakify.org/lessons/integer_float_numbers/ ++ If you don't know how to start solving this assignment, please review the theory for this lesson: https://snakify.org/lessons/integer_float_numbers/ + You may also try step-by-step theory chunks: https://snakify.org/lessons/integer_float_numbers/steps/1/ From c9a575dad7cb228da41bd54ef14621b83265f79e Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 01:21:37 +0100 Subject: [PATCH 55/63] Update README.es.md --- exercises/016-century/README.es.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/exercises/016-century/README.es.md b/exercises/016-century/README.es.md index 7a0d57cf..3dfeb873 100644 --- a/exercises/016-century/README.es.md +++ b/exercises/016-century/README.es.md @@ -12,11 +12,13 @@ century(2001) ## Ejemplo de salida: -+ 21 +```py +21 +``` ## 💡 Pistas: -+ Ten en cuenta que, por ejemplo, el s.XX (siglo 20) comienza en el año 1901. ++ Ten en cuenta que, por ejemplo, el s. XX (siglo 20) comienza en el año 1901. + Si no sabes por donde comenzar este ejercicio, por favor, revisa la teoría en esta lección: https://snakify.org/lessons/integer_float_numbers/ From 00747ed5ca7fc205ff73f3f12a67f595d90de4ab Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 01:21:48 +0100 Subject: [PATCH 56/63] Update README.es.md --- exercises/016-century/README.es.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/016-century/README.es.md b/exercises/016-century/README.es.md index 3dfeb873..407fc07b 100644 --- a/exercises/016-century/README.es.md +++ b/exercises/016-century/README.es.md @@ -4,13 +4,13 @@ 1. Escribe una función `century()` para que dado un año (como un entero positivo), encuentre su posición respectiva dentro del siglo. -## Ejemplo de entrada: +## 📎 Ejemplo de entrada: ```py century(2001) ``` -## Ejemplo de salida: +## 📎 Ejemplo de salida: ```py 21 From f07dbf8386e3f4cfe970bb9d8ad65f6e7ae736a1 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 01:21:56 +0100 Subject: [PATCH 57/63] Update README.md --- exercises/016-century/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/016-century/README.md b/exercises/016-century/README.md index e56775e1..650c1d87 100644 --- a/exercises/016-century/README.md +++ b/exercises/016-century/README.md @@ -10,7 +10,7 @@ century(2001) ``` -## 📎Example output: +## 📎 Example output: ```py 21 From 3ed937c9f2af1177cb6515f94e4d3be3fee2d29a Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 01:22:27 +0100 Subject: [PATCH 58/63] Update README.md --- exercises/016-century/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/exercises/016-century/README.md b/exercises/016-century/README.md index 650c1d87..fd61c030 100644 --- a/exercises/016-century/README.md +++ b/exercises/016-century/README.md @@ -20,6 +20,8 @@ century(2001) + Note that, for example, the 20th century began with the year 1901. ++ You may need to import the `math` module. + + If you don't know how to start solving this assignment, please review the theory for this lesson: https://snakify.org/lessons/integer_float_numbers/ + You may also try step-by-step theory chunks: https://snakify.org/lessons/integer_float_numbers/steps/1/ From 299aa8d30c457ffceccadbeab7777b001794cc7a Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 01:22:51 +0100 Subject: [PATCH 59/63] Update README.es.md --- exercises/016-century/README.es.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/exercises/016-century/README.es.md b/exercises/016-century/README.es.md index 407fc07b..394e5236 100644 --- a/exercises/016-century/README.es.md +++ b/exercises/016-century/README.es.md @@ -20,6 +20,8 @@ century(2001) + Ten en cuenta que, por ejemplo, el s. XX (siglo 20) comienza en el año 1901. ++ Sería buena idea que importaras el módulo `math` para este ejercicio. + + Si no sabes por donde comenzar este ejercicio, por favor, revisa la teoría en esta lección: https://snakify.org/lessons/integer_float_numbers/ From d4f674590b3d7ccc05879942db84ae95721b1f5d Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 01:23:16 +0100 Subject: [PATCH 60/63] Update app.py --- exercises/016-century/app.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/exercises/016-century/app.py b/exercises/016-century/app.py index 8ce39bb2..54c39550 100644 --- a/exercises/016-century/app.py +++ b/exercises/016-century/app.py @@ -1,10 +1,7 @@ -#Complete the function to return the respective number of the century -#HINT: You may need to import the math module. - +# Complete the function to return the respective number of the century def century(year): return None - -#Invoke the function with any given year. -print(century()) \ No newline at end of file +# Invoke the function with any given year +print(century()) From 5cf180ad15f1342f4b6d6d6d6ef7ba14e488e57f Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 01:24:02 +0100 Subject: [PATCH 61/63] Update solution.hide.py --- exercises/016-century/solution.hide.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/exercises/016-century/solution.hide.py b/exercises/016-century/solution.hide.py index eae36927..c26da58a 100644 --- a/exercises/016-century/solution.hide.py +++ b/exercises/016-century/solution.hide.py @@ -1,6 +1,6 @@ -#Complete the function to return the respective number of the century -#HINT: You may need to import the math module. import math + +# Complete the function to return the respective number of the century def century(year): if year % 100 == 0: return math.floor(year/100) @@ -8,6 +8,5 @@ def century(year): return math.floor(year/100 +1) - -#Invoke the function with any given year. -print(century(2022)) \ No newline at end of file +# Invoke the function with any given year +print(century(2024)) From db4ea9e379a2e4353ab0a004888ebd979b7142e0 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 01:28:59 +0100 Subject: [PATCH 62/63] Update solution.hide.py --- exercises/016-century/solution.hide.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/016-century/solution.hide.py b/exercises/016-century/solution.hide.py index c26da58a..1b9a08dc 100644 --- a/exercises/016-century/solution.hide.py +++ b/exercises/016-century/solution.hide.py @@ -3,9 +3,9 @@ # Complete the function to return the respective number of the century def century(year): if year % 100 == 0: - return math.floor(year/100) + return math.floor(year / 100) else: - return math.floor(year/100 +1) + return math.floor(year / 100 + 1) # Invoke the function with any given year From 2d3bde653d3e8803a299f1363aea8ae08b957671 Mon Sep 17 00:00:00 2001 From: Jose Mora <109150320+josemoracard@users.noreply.github.com> Date: Wed, 13 Dec 2023 01:32:54 +0100 Subject: [PATCH 63/63] Update test.py --- exercises/016-century/test.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/016-century/test.py b/exercises/016-century/test.py index f97fea1f..28300864 100644 --- a/exercises/016-century/test.py +++ b/exercises/016-century/test.py @@ -21,15 +21,15 @@ def test_function_return(capsys, app): def test_function_return_type(capsys, app): assert type(app.century(19001)) == type(1) -@pytest.mark.it('We tried to pass 2000 as parameter and it did not return 20!') +@pytest.mark.it('We tried to pass 2000 as parameter and it did not return 20') def test_for_file_output(capsys, app): assert app.century(2000) == 20 -@pytest.mark.it('We tried to pass 2000 as parameter and it did not return 21!') +@pytest.mark.it('We tried to pass 2001 as parameter and it did not return 21') def test_for_file_output2(capsys, app): assert app.century(2001) == 21 -@pytest.mark.it('We tried to pass 2000 as parameter and it did not return 21!') +@pytest.mark.it('We tried to pass 2101 as parameter and it did not return 22') def test_for_file_output3(capsys, app): assert app.century(2101) == 22