diff --git a/exercises/000-welcome/README.es.md b/exercises/000-welcome/README.es.md new file mode 100644 index 00000000..f4323175 --- /dev/null +++ b/exercises/000-welcome/README.es.md @@ -0,0 +1,16 @@ +# Bienvenid@ a Python! + +¡¡Nos estusiasma mucho tenerte aquí!! 🎉 😂 + +Este es el último de una serie de ejercicios publicados para practicar Python desde cero por [@alesanchezr](https://twitter.com/alesanchezr) y [4GeeksAcademy](https://4geeksacademy.com). + +Si no haz completado los otros ejercicios te recomiendo que empieces por alli: + +1. [Python for beginners](https://github.com/4GeeksAcademy/python-beginner-programming-exercises) + +2. [Practice Looping Lists and Tuples](https://github.com/4GeeksAcademy/python-lists-loops-programming-exercises) + +3. [Practice Functions](https://github.com/4GeeksAcademy/python-functions-programming-exercises) + + +Presiona `Next →` en la esquina superior derecha cuando quieras empezar. diff --git a/exercises/000-welcome/README.md b/exercises/000-welcome/README.md new file mode 100644 index 00000000..3e873388 --- /dev/null +++ b/exercises/000-welcome/README.md @@ -0,0 +1,15 @@ +# Welcome to Python! + +We are very excited to have you here !! 🎉 😂 + +This is the last series of exercises of a list of Python interactive tutorials published by [@alesanchezr](https://twitter.com/alesanchezr) with [4GeeksAcademy](https://4geeksacademy.com). + +If you have not completed them and you are new to javascript, I strongly recomend you start with: + +1. [Python for beginners](https://github.com/4GeeksAcademy/python-beginner-programming-exercises) + +2. [Practice Looping Lists and Tuples](https://github.com/4GeeksAcademy/python-lists-loops-programming-exercises) + +3. [Practice Functions](https://github.com/4GeeksAcademy/python-functions-programming-exercises) + +Click `Next →` on the top right of this instructions when you are ready to start. \ No newline at end of file diff --git a/exercises/02-hello-world/README.es.md b/exercises/001-hello_world/README.es.md similarity index 56% rename from exercises/02-hello-world/README.es.md rename to exercises/001-hello_world/README.es.md index ce98ce3c..2c9587be 100644 --- a/exercises/02-hello-world/README.es.md +++ b/exercises/001-hello_world/README.es.md @@ -1,21 +1,21 @@ -# `02` Hola, Mundo +# `001` hello world En Python, usamos `print` para hacer que el computador escriba cualquier cosa que queramos (el contenido de una variable, un texto dado, etc.) in algo llamado `la consola`. Cada idioma tiene funciones para integrarse con la consola, ya que al principio era la única forma de interactuar con los usuarios (antes de que llegara Windows o MacOS o Linux). -Hoy en día, la impresión en la consola se utiliza sobre todo como herramienta de monitorización, ideal para dejar un rastro del contenido de las variables durante la ejecución del programa. +Hoy en día, la impresión en la consola se utiliza sobre todo como herramienta de monitoreo, ideal para dejar un rastro del contenido de las variables durante la ejecución del programa. + +## Ejemplo: -Este es un ejemplo de cómo usarlo: ```py print("How are you?") ``` ## 📝 Instrucciones: -1. Usa la función `print()` para escribir "Hello World" en la consola. Siéntete libre de intentar otras cosas también. +1. Usa la función `print()` para escribir `"Hello World"` en la consola. Siéntete libre de intentar otras cosas también. ## 💡 Pista: -Video de 5 minutos sobre la consola: -https://www.youtube.com/watch?v=vROGBvX_MHQ ++ Video de 5 minutos sobre [la consola](https://www.youtube.com/watch?v=vROGBvX_MHQ) diff --git a/exercises/02-hello-world/README.md b/exercises/001-hello_world/README.md similarity index 82% rename from exercises/02-hello-world/README.md rename to exercises/001-hello_world/README.md index c20928db..759cd90c 100644 --- a/exercises/02-hello-world/README.md +++ b/exercises/001-hello_world/README.md @@ -1,4 +1,4 @@ -# `02` Hello World +# `001` hello world In Python, we use `print` to make the computer write anything we want (the content of a variable, a given string, etc.) in something called "the console". @@ -6,7 +6,8 @@ Every language has a console, as it was the only way to interact with the users Today, printing in the console is used mostly as a monitoring tool, ideal to leave a trace of the content of variables during the program execution. -This is an example of how to use it: +## Example: + ```py print("How are you?") ``` @@ -17,5 +18,4 @@ print("How are you?") ## 💡 Hint: -5 minutes video about the console: -https://www.youtube.com/watch?v=1RlkftxAo-M \ No newline at end of file ++ 5 minutes video about [the console](https://www.youtube.com/watch?v=1RlkftxAo-M) \ No newline at end of file diff --git a/exercises/02-hello-world/app.py b/exercises/001-hello_world/app.py similarity index 100% rename from exercises/02-hello-world/app.py rename to exercises/001-hello_world/app.py diff --git a/exercises/02-hello-world/test.py b/exercises/001-hello_world/test.py similarity index 100% rename from exercises/02-hello-world/test.py rename to exercises/001-hello_world/test.py diff --git a/exercises/002-sum_of_three_numbers/README.es.md b/exercises/002-sum_of_three_numbers/README.es.md new file mode 100644 index 00000000..e9940523 --- /dev/null +++ b/exercises/002-sum_of_three_numbers/README.es.md @@ -0,0 +1,16 @@ +# `002` sum of three numbers + +## 📝 Instrucciones: + +1. Teniendo tres números de entrada, imprime su suma. Cada número va en una línea aparte. + +## Ejemplo de entrada: + ++ 2 ++ 3 ++ 6 + +## Ejemplo de salida: + ++ 11 + diff --git a/exercises/03-sum_of_three_numbers/README.md b/exercises/002-sum_of_three_numbers/README.md similarity index 59% rename from exercises/03-sum_of_three_numbers/README.md rename to exercises/002-sum_of_three_numbers/README.md index e657813d..a20c2a61 100644 --- a/exercises/03-sum_of_three_numbers/README.md +++ b/exercises/002-sum_of_three_numbers/README.md @@ -1,16 +1,16 @@ -# `03` Sum of three numbers +# `002` sum of three numbers ## 📝 Instructions: 1. Taking 3 numbers from the input, print their sum. Every number is given on a separate line. -### Example input: +## Example input: -- 2 -- 3 -- 6 ++ 2 ++ 3 ++ 6 -### Example output: +## Example output: -- 11 ++ 11 diff --git a/exercises/03-sum_of_three_numbers/app.py b/exercises/002-sum_of_three_numbers/app.py similarity index 100% rename from exercises/03-sum_of_three_numbers/app.py rename to exercises/002-sum_of_three_numbers/app.py diff --git a/exercises/03-sum_of_three_numbers/test.py b/exercises/002-sum_of_three_numbers/test.py similarity index 100% rename from exercises/03-sum_of_three_numbers/test.py rename to exercises/002-sum_of_three_numbers/test.py diff --git a/exercises/003-area_of_right_triangle/README.es.md b/exercises/003-area_of_right_triangle/README.es.md new file mode 100644 index 00000000..3d79f662 --- /dev/null +++ b/exercises/003-area_of_right_triangle/README.es.md @@ -0,0 +1,19 @@ +# `003` area of right triangle + +## 📝 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. + +![Imagen descriptiva](http://i.imgur.com/6EkzVxA.jpg) + +## Ejemplo: + +```py +area_of_triangle(3,5) + print(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/ + ++ 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 diff --git a/exercises/003-area_of_right_triangle/README.md b/exercises/003-area_of_right_triangle/README.md new file mode 100644 index 00000000..0b0b2754 --- /dev/null +++ b/exercises/003-area_of_right_triangle/README.md @@ -0,0 +1,19 @@ +# `003` area of right triangle + +## 📝 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. + +![Image description](http://i.imgur.com/6EkzVxA.jpg) + +## Ejemplo: + +```py +area_of_triangle(3,5) + print(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/ + ++ You may also try step-by-step theory chunks: https://snakify.org/lessons/print_input_numbers/steps/1/ \ No newline at end of file diff --git a/exercises/04-area_of_right_triangle/app.py b/exercises/003-area_of_right_triangle/app.py similarity index 100% rename from exercises/04-area_of_right_triangle/app.py rename to exercises/003-area_of_right_triangle/app.py diff --git a/exercises/04-area_of_right_triangle/test.py b/exercises/003-area_of_right_triangle/test.py similarity index 100% rename from exercises/04-area_of_right_triangle/test.py rename to exercises/003-area_of_right_triangle/test.py diff --git a/exercises/004-hello_harry/README.es.md b/exercises/004-hello_harry/README.es.md new file mode 100644 index 00000000..22798332 --- /dev/null +++ b/exercises/004-hello_harry/README.es.md @@ -0,0 +1,26 @@ +# `004` hello Harry + +## 📝 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. + +*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: + +```py +hello_name("Harry") +``` +## Ejemplo de salida: + +Hello, Harry! + +## 💡 Pistas: + ++ Puedes usar el operador '+' para concatenar dos strings de texto. Ve 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/ + ++ También puedes intentar paso a paso con trozos de la teoría: +https://snakify.org/lessons/print_input_numbers/steps/1/ diff --git a/exercises/004-hello_harry/README.md b/exercises/004-hello_harry/README.md new file mode 100644 index 00000000..cb5743e7 --- /dev/null +++ b/exercises/004-hello_harry/README.md @@ -0,0 +1,25 @@ +# `004` hello Harry + +## 📝 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. + +*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: + +```py +hello_name("Harry") +``` + +## Example output: + +Hello, Harry! + +## 💡 Hints: + ++ You can use '+' operator to concatenate two strings. See 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/ + ++ You may also try step-by-step theory chunks: https://snakify.org/lessons/print_input_numbers/steps/1/ diff --git a/exercises/05-hello_harry/app.py b/exercises/004-hello_harry/app.py similarity index 100% rename from exercises/05-hello_harry/app.py rename to exercises/004-hello_harry/app.py diff --git a/exercises/05-hello_harry/test.py b/exercises/004-hello_harry/test.py similarity index 100% rename from exercises/05-hello_harry/test.py rename to exercises/004-hello_harry/test.py diff --git a/exercises/005-previous_and_next/README.es.md b/exercises/005-previous_and_next/README.es.md new file mode 100644 index 00000000..8607726d --- /dev/null +++ b/exercises/005-previous_and_next/README.es.md @@ -0,0 +1,23 @@ +# `005` previous and next + +## 📝 Instrucciones: + +1. Completa la función `previous_next()` para que lea un número entero y devuelva sus números anteriores y siguientes. + +## Ejemplo: + +```py +previous_next(179) +``` + +## Ejemplo de salida: + ++ (178, 180) + +## 💡 Pistas: + ++ 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 diff --git a/exercises/005-previous_and_next/README.md b/exercises/005-previous_and_next/README.md new file mode 100644 index 00000000..e26caf6e --- /dev/null +++ b/exercises/005-previous_and_next/README.md @@ -0,0 +1,22 @@ +# `005` previous and next + +## 📝 Instructions: + +1. Complete a function `previous_next()` that reads an integer number and returns its previous and next numbers. + +## Example input: + +```py +previous_next(179) +``` +## Example output: + ++ (178, 180) + +## 💡 Hints: + ++ 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/ + ++ You may also try step-by-step theory chunks: https://snakify.org/lessons/print_input_numbers/steps/1/ \ No newline at end of file diff --git a/exercises/06-previous_and_next/app.py b/exercises/005-previous_and_next/app.py similarity index 100% rename from exercises/06-previous_and_next/app.py rename to exercises/005-previous_and_next/app.py diff --git a/exercises/06-previous_and_next/test.py b/exercises/005-previous_and_next/test.py similarity index 100% rename from exercises/06-previous_and_next/test.py rename to exercises/005-previous_and_next/test.py diff --git a/exercises/006-apple_sharing/README.es.md b/exercises/006-apple_sharing/README.es.md new file mode 100644 index 00000000..cac76b43 --- /dev/null +++ b/exercises/006-apple_sharing/README.es.md @@ -0,0 +1,25 @@ +# `007` apple sharing + +## 📝 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.* + +## Ejemplo de entrada: + +```py +apple_sharing(6, 50) +``` + +## Ejemplo de salida: + ++ (8, 2) + +## 💡 Pistas: + ++ 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 diff --git a/exercises/006-apple_sharing/README.md b/exercises/006-apple_sharing/README.md new file mode 100644 index 00000000..e7121d89 --- /dev/null +++ b/exercises/006-apple_sharing/README.md @@ -0,0 +1,26 @@ +# `007` apple sharing + +## 📝 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.* + +## Example input: + +```py +apple_sharing(6, 50) +``` + +## Example output: + ++ (8, 2) + + +## 💡 Hints: + ++ 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/ + ++ You may also try step-by-step theory chunks: +https://snakify.org/lessons/print_input_numbers/steps/1/ \ No newline at end of file diff --git a/exercises/07-Apple_sharing/app.py b/exercises/006-apple_sharing/app.py similarity index 100% rename from exercises/07-Apple_sharing/app.py rename to exercises/006-apple_sharing/app.py diff --git a/exercises/07-Apple_sharing/test.py b/exercises/006-apple_sharing/test.py similarity index 100% rename from exercises/07-Apple_sharing/test.py rename to exercises/006-apple_sharing/test.py diff --git a/exercises/006.1-square_value_of_number/README.es.md b/exercises/006.1-square_value_of_number/README.es.md new file mode 100644 index 00000000..7316cd10 --- /dev/null +++ b/exercises/006.1-square_value_of_number/README.es.md @@ -0,0 +1,9 @@ +# `006.1` square value of number + +## 📝 Instrucciones: + +1. Escribe una función llamada `square()` que calcule el valor al cuadrado de un número + +## 💡 Pista: + ++ Usa el operador `**`. diff --git a/exercises/006.1-square_value_of_number/README.md b/exercises/006.1-square_value_of_number/README.md new file mode 100644 index 00000000..3c850748 --- /dev/null +++ b/exercises/006.1-square_value_of_number/README.md @@ -0,0 +1,9 @@ +# `006.1` square value of number + +## 📝 Instructions + +1. Write a function called `square()` that calculates the square value of a number. + +## 💡 Hint: + ++ Using the `**` operator diff --git a/exercises/07.1-square-value/app.py b/exercises/006.1-square_value_of_number/app.py similarity index 100% rename from exercises/07.1-square-value/app.py rename to exercises/006.1-square_value_of_number/app.py diff --git a/exercises/07.1-square-value/solution.hide.py b/exercises/006.1-square_value_of_number/solution.hide.py similarity index 100% rename from exercises/07.1-square-value/solution.hide.py rename to exercises/006.1-square_value_of_number/solution.hide.py diff --git a/exercises/07.1-square-value/test.py b/exercises/006.1-square_value_of_number/test.py similarity index 100% rename from exercises/07.1-square-value/test.py rename to exercises/006.1-square_value_of_number/test.py diff --git a/exercises/007-hours_and_minutes/README.es.md b/exercises/007-hours_and_minutes/README.es.md new file mode 100644 index 00000000..8ebe02de --- /dev/null +++ b/exercises/007-hours_and_minutes/README.es.md @@ -0,0 +1,27 @@ +# `007` hours and minutes + +## 📝 Instrucciones: + + 1. Dado el número entero `N` - el número de segundos que pasan desde la medianoche ¿Cuántas horas y minutos completos han pasado desde la medianoche? *La función debe imprimir dos números: el número de horas (entre 0 y 23) y el número de minutos (entre 0 y 1339)*. + +## Ejemplo: + +* Si N = 3900 --> han pasado 3900 segundos desde la medianoche ,es decir, ahora es la 1:05 am. + ++ El programa debe imprimir 1 65 --> 1 hora completa ha pasado desde la medianoche, 65 minutos completos han pasado desde la medianoche. + +## Ejemplo de entrada: + +```py +hours_minutes(3900) +``` + +## Ejemplo de salida: + ++ (1, 65) + +## 💡 Pistas: + ++ Si no sabes por donde partir este ejercicio por favor, revisa la teoría en esta lección: ttps://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/ diff --git a/exercises/007-hours_and_minutes/README.md b/exercises/007-hours_and_minutes/README.md new file mode 100644 index 00000000..6fe82396 --- /dev/null +++ b/exercises/007-hours_and_minutes/README.md @@ -0,0 +1,27 @@ +# `007` hours and minutes + +## 📝 Instructions: + +1. Given the integer `N` - the number of seconds that is passed since midnight. - How many full hours and full minutes are passed since midnight? *The program should print two numbers: the number of hours (between 0 and 23) and the number of minutes (between 0 and 1339)*. + +## Example: + ++ If N = 3900 --> then 3900 seconds have passed since midnight - i.e. now it's 1:05am. + ++ So the program should print 1 65 --> 1 full hour is passed since midnight, 65 full minutes passed since midnight. + +## Example input: + +```py +hours_minutes(3900) +``` + +## Example output: + ++ (1, 65) + +## 💡 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/ diff --git a/exercises/08-hours_and_minutes/app.py b/exercises/007-hours_and_minutes/app.py similarity index 100% rename from exercises/08-hours_and_minutes/app.py rename to exercises/007-hours_and_minutes/app.py diff --git a/exercises/08-hours_and_minutes/test.py b/exercises/007-hours_and_minutes/test.py similarity index 100% rename from exercises/08-hours_and_minutes/test.py rename to exercises/007-hours_and_minutes/test.py diff --git a/exercises/008-two_timestamps/README.es.md b/exercises/008-two_timestamps/README.es.md new file mode 100644 index 00000000..009002e9 --- /dev/null +++ b/exercises/008-two_timestamps/README.es.md @@ -0,0 +1,31 @@ +# `008` two timestamps + +## 📝 Instrucciones: + +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: + +```py +two_timestamp(1,1,1,2,2,2) +``` + +## Ejemplo de salida #1: + ++ 3661 + +## Ejemplo de entrada #2: + +```py +two_timestamp(1,2,30,1,3,20) +``` + +## 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 diff --git a/exercises/008-two_timestamps/README.md b/exercises/008-two_timestamps/README.md new file mode 100644 index 00000000..b87af83c --- /dev/null +++ b/exercises/008-two_timestamps/README.md @@ -0,0 +1,31 @@ +# `008` two timestamps + +## 📝 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. + +## Example input #1: + +```py +two_timestamp(1,1,1,2,2,2) +``` + +## Example output #1: + ++ 3661 + +## Example input #2: + +```py +two_timestamp(1,2,30,1,3,20) +``` + +## 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/ diff --git a/exercises/09-Two_timestamps/app.py b/exercises/008-two_timestamps/app.py similarity index 100% rename from exercises/09-Two_timestamps/app.py rename to exercises/008-two_timestamps/app.py diff --git a/exercises/09-Two_timestamps/test.py b/exercises/008-two_timestamps/test.py similarity index 100% rename from exercises/09-Two_timestamps/test.py rename to exercises/008-two_timestamps/test.py diff --git a/exercises/009-two_digits/README.es.md b/exercises/009-two_digits/README.es.md new file mode 100644 index 00000000..badb4e46 --- /dev/null +++ b/exercises/009-two_digits/README.es.md @@ -0,0 +1,21 @@ +# `009` two digits + +## 📝 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. + +## Ejemplo de entrada: + +```py +two_digits(79) +``` + +## 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 diff --git a/exercises/009-two_digits/README.md b/exercises/009-two_digits/README.md new file mode 100644 index 00000000..6af77973 --- /dev/null +++ b/exercises/009-two_digits/README.md @@ -0,0 +1,21 @@ +# `009` two digits + +## 📝 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. + +## Example input: + +```py +two_digits(79) +``` + +## 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 diff --git a/exercises/10-Two_digits/app.py b/exercises/009-two_digits/app.py similarity index 100% rename from exercises/10-Two_digits/app.py rename to exercises/009-two_digits/app.py diff --git a/exercises/10-Two_digits/test.py b/exercises/009-two_digits/test.py similarity index 100% rename from exercises/10-Two_digits/test.py rename to exercises/009-two_digits/test.py diff --git a/exercises/01-welcome/README.es.md b/exercises/01-welcome/README.es.md deleted file mode 100644 index 4df18bab..00000000 --- a/exercises/01-welcome/README.es.md +++ /dev/null @@ -1,4 +0,0 @@ -# Bienvenid@ a Python! - -¡¡Nos estusiasma mucho tenerte aquí!! 🎉 😂 -Presiona `Next →` de arriba a la derecha cuando quieras empezar. diff --git a/exercises/01-welcome/README.md b/exercises/01-welcome/README.md deleted file mode 100644 index 6358f29d..00000000 --- a/exercises/01-welcome/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Welcome to Python! - -We are very excited to have you here !! 🎉 😂 -Click `Next →` on the top right of this instructions when you are ready to start. \ No newline at end of file diff --git a/exercises/010-swap_digits/README.es.md b/exercises/010-swap_digits/README.es.md new file mode 100644 index 00000000..3f2c5c84 --- /dev/null +++ b/exercises/010-swap_digits/README.es.md @@ -0,0 +1,25 @@ +# `010` swap digits + +## 📝 Instrucciones: + +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: + +```py +swap_digits(79) +``` + +## Ejemplo de salida: + ++ 97 + +## 💡 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. diff --git a/exercises/11-Swap_digits/README.md b/exercises/010-swap_digits/README.md similarity index 69% rename from exercises/11-Swap_digits/README.md rename to exercises/010-swap_digits/README.md index e63c9a90..fe97fdfa 100644 --- a/exercises/11-Swap_digits/README.md +++ b/exercises/010-swap_digits/README.md @@ -1,8 +1,8 @@ -# `11` Swap Digits +# `010` swap digits ## 📝 Instructions: -1. Create a function named `swap_digits()` given a two-digit integer, swap its digits and print the result. +1. Complete a function named `swap_digits()`. Given a two-digit integer, `swap_digits()` swap its digits and prints the result. ## Example input: @@ -12,11 +12,9 @@ swap_digits(79) ## Example output: -``` -97 -``` ++ 97 -## 💡 Hint: +## 💡 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/ @@ -24,4 +22,4 @@ swap_digits(79) + Note that you need to concatenate two numbers, so you may have to convert them into a string `str(number)`. -+ The function must return a number. ++ The function must return an integer. diff --git a/exercises/11-Swap_digits/app.py b/exercises/010-swap_digits/app.py similarity index 100% rename from exercises/11-Swap_digits/app.py rename to exercises/010-swap_digits/app.py diff --git a/exercises/11-Swap_digits/test.py b/exercises/010-swap_digits/test.py similarity index 100% rename from exercises/11-Swap_digits/test.py rename to exercises/010-swap_digits/test.py diff --git a/exercises/03-sum_of_three_numbers/README.es.md b/exercises/03-sum_of_three_numbers/README.es.md deleted file mode 100644 index 1553a6d9..00000000 --- a/exercises/03-sum_of_three_numbers/README.es.md +++ /dev/null @@ -1,16 +0,0 @@ -# `03` Sum of three numbers - -## 📝 Instrucciones: - -1. Obteniendo tres números de la entrada, imprime su suma. Cada número es dado en una línea aparte. - -### Ejemplo de entrada: - -- 2 -- 3 -- 6 - -### Ejemplo de salida: - -- 11 - diff --git a/exercises/04-area_of_right_triangle/README.es.md b/exercises/04-area_of_right_triangle/README.es.md deleted file mode 100644 index 04f7780b..00000000 --- a/exercises/04-area_of_right_triangle/README.es.md +++ /dev/null @@ -1,24 +0,0 @@ -# `04` Área de un triángulo rectángulo - -## 📝 Instrucciones: - -1. Escribe un programa que lea la longitud 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. - -![Imagen descriptiva](http://i.imgur.com/6EkzVxA.jpg) - -### Ejemplo de entrada: - -* 3 -* 5 - -### Ejemplo de salida: - -* 7.5 - -## 💡 Pista: - -+ Si no sabes cómo empezar la solución a este problema, 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 diff --git a/exercises/04-area_of_right_triangle/README.md b/exercises/04-area_of_right_triangle/README.md deleted file mode 100644 index 4295f8ef..00000000 --- a/exercises/04-area_of_right_triangle/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# `04` Area of right triangle - -## 📝 Instructions: - -1. Write a program that 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) - -### Example input: - -+ 5 - -### Example output: - -+ 7.5 - -## 💡 Hint: - -+ 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 diff --git a/exercises/05-hello_harry/README.es.md b/exercises/05-hello_harry/README.es.md deleted file mode 100644 index d3ad7c1c..00000000 --- a/exercises/05-hello_harry/README.es.md +++ /dev/null @@ -1,23 +0,0 @@ -# `05` Hola Harry - -## 📝 Instrucciones: - -1. Escribe un programa que salude al usuario imprimiendo la palabra `Hello`, una coma, el nombre del usuario y un signo de exclamación después de él. Ve los ejemplos a continuación. - -La salida de tu programa debe coincidir estrictamente con la deseada, caracter por caracter. No debe haber ningún espacio entre el nombre y el signo de exclamación. Puedes usar el operador + para concatenar dos cadenas de texto. Ve la lección para más detalles. - -### Ejemplo de entrada: - -+ Harry - -### Ejemplo de salida: - -+ Hello, Harry! - -## 💡 Pista: - -+ 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/ diff --git a/exercises/05-hello_harry/README.md b/exercises/05-hello_harry/README.md deleted file mode 100644 index 466d0a32..00000000 --- a/exercises/05-hello_harry/README.md +++ /dev/null @@ -1,24 +0,0 @@ -# `05` Hello Harry - -## 📝 Instructions: - -1. Write a program that greets the user by printing the word `Hello`, a comma, the name of the user and an exclamation mark after it. See the examples below. - -Your program's output should strictly match the desired one, character by character. There shouldn't be any space between the name and the exclamation mark. You can use + operator to concatenate two strings. See the lesson for details. - - -### Example input: - -+ Harry - -### Example output: - -+ Hello, Harry! - -## 💡 Hint: - -+ 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/ diff --git a/exercises/06-previous_and_next/README.es.md b/exercises/06-previous_and_next/README.es.md deleted file mode 100644 index 8634c335..00000000 --- a/exercises/06-previous_and_next/README.es.md +++ /dev/null @@ -1,23 +0,0 @@ -# `06` Anterior y siguiente - -## 📝 Instrucciones: - -1. Escribe un programa que lea un número entero y devuelva sus números anteriores y siguientes. Ve el ejemplo a continuación. - -### Ejemplo de entrada: - -+ 179 - -### Ejemplo de salida: - -+ (178, 180) - -## 💡 Pista: - -+ Puedes devolver múltiples parámetros: `return a, b` - -+ 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/ \ No newline at end of file diff --git a/exercises/06-previous_and_next/README.md b/exercises/06-previous_and_next/README.md deleted file mode 100644 index 47e19f90..00000000 --- a/exercises/06-previous_and_next/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# `06` Previous and Next - -## 📝 Instructions: - -1. Write a program that reads an integer number and returns its previous and next numbers. See the example below. - -### Example input: - -+ 179 - -### Example output: - -+ (178, 180) - -## 💡 Hint: - -+ 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/ - -+ You may also try step-by-step theory chunks: -https://snakify.org/lessons/print_input_numbers/steps/1/ \ No newline at end of file diff --git a/exercises/07-Apple_sharing/README.es.md b/exercises/07-Apple_sharing/README.es.md deleted file mode 100644 index e8473f70..00000000 --- a/exercises/07-Apple_sharing/README.es.md +++ /dev/null @@ -1,27 +0,0 @@ -# `07` Compartiendo una manzana - -## 📝 Instrucciones: - -N estudiantes cogen K manzanas y las distribuyen entre ell@s de manera uniforme. La parte restante (la indivisible) permanece en la cesta. - -1. ¿Cuántas manzanas recibirá cada estudiante? y ¿Cuántas manzanas quedarán en la cesta? - -El programa lee los números N y K. Debería devolver las dos respuestas a las preguntas anteriores. - -### Ejemplo de entrada: - -+ (6, 50) - -### Ejemplo de salida: - -+ (8, 2) - -## 💡 Pista: - -+ Puedes devolver múltiples parámetros: `return a, b` - -+ 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/ \ No newline at end of file diff --git a/exercises/07-Apple_sharing/README.md b/exercises/07-Apple_sharing/README.md deleted file mode 100644 index 6e8a2176..00000000 --- a/exercises/07-Apple_sharing/README.md +++ /dev/null @@ -1,28 +0,0 @@ -# `07` Apple Sharing - -## 📝 Instructions: - -N students take K apples and distribute them among each other evenly. The remaining (the indivisible) part remains in the basket. - -1. How many apples will each single student get? How many apples will remain in the basket? - -The program reads the numbers `N` and `K`. It should return the two answers for the questions above. - -### Example input: - -+ (6, 50) - -### Example output: - -+ (8, 2) - - -## 💡 Pista: - -+ 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/ - -+ You may also try step-by-step theory chunks: -https://snakify.org/lessons/print_input_numbers/steps/1/ \ No newline at end of file diff --git a/exercises/07.1-square-value/README.es.md b/exercises/07.1-square-value/README.es.md deleted file mode 100644 index f92d562e..00000000 --- a/exercises/07.1-square-value/README.es.md +++ /dev/null @@ -1,9 +0,0 @@ -# 07.1 El cuadrado de un número - -## 📝 Instrucciones: - -1. Escribe una función llamada `square` que calculará el valor cuadrado de un número - -## 💡 Pista: - -+ Usa el operador `**`. diff --git a/exercises/07.1-square-value/README.md b/exercises/07.1-square-value/README.md deleted file mode 100644 index 4a8917a9..00000000 --- a/exercises/07.1-square-value/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# 07.1 Square Value of Number - -## 📝 Instructions - -1. Write a function called `square` which can calculate square value of number. - -## 💡 Hint: - -+ Using the ** operator diff --git a/exercises/08-hours_and_minutes/README.es.md b/exercises/08-hours_and_minutes/README.es.md deleted file mode 100644 index eecb46b1..00000000 --- a/exercises/08-hours_and_minutes/README.es.md +++ /dev/null @@ -1,32 +0,0 @@ -# `08` Horas y minutos - -## 📝 Instrucciones: - -Dado el número entero `N` - el número de segundos que pasan desde la medianoche: - - 1. ¿cuántas horas y minutos completos han pasado desde la medianoche? - -El programa debe imprimir dos números: el número de horas (entre 0 y 23) y el número de minutos (entre 0 y 1339). - -Por ejemplo: - -* Si N = 3900 --> han pasado 3900 segundos desde la medianoche ,es decir, ahora es la 1:05 am. - -El programa debe imprimir 1 65 --> 1 hora completa ha pasado desde la medianoche, 65 minutos completos han pasado desde la medianoche. - - -### Ejemplo de entrada: - -+ 3900 - -### Ejemplo de salida: - -+ (1, 65) - -## 💡 Pista: - -+ 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/ diff --git a/exercises/08-hours_and_minutes/README.md b/exercises/08-hours_and_minutes/README.md deleted file mode 100644 index 498aa29b..00000000 --- a/exercises/08-hours_and_minutes/README.md +++ /dev/null @@ -1,31 +0,0 @@ -# `08` Hours and Minutes - -## 📝 Instructions: - -Given the integer N - the number of seconds that is passed since midnight - - -1. How many full hours and full minutes are passed since midnight? - -The program should print two numbers: the number of hours (between 0 and 23) and the number of minutes (between 0 and 1339). - -For example: - -* If N = 3900 --> then 3900 seconds have passed since midnight - i.e. now it's 1:05am. - -So the program should print 1 65 --> 1 full hour is passed since midnight, 65 full minutes passed since midnight. - -### Example input: - -+ 3900 - -### Example output: - -+ (1, 65) - -## 💡 Hint: - -+ 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/ diff --git a/exercises/09-Two_timestamps/README.es.md b/exercises/09-Two_timestamps/README.es.md deleted file mode 100644 index a88db48c..00000000 --- a/exercises/09-Two_timestamps/README.es.md +++ /dev/null @@ -1,43 +0,0 @@ -# `09` Dos marcas de tiempo - -## 📝 Instrucciones: - -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. - -1. Calcula cuántos segundos pasaron entre ellos. - -### Ejemplo de entrada #1: - -+ 1 -+ 1 -+ 1 -+ 2 -+ 2 -+ 2 - -### Ejemplo de salida #1: - -+ 3661 - -### Ejemplo de entrada #2: - -+ 1 -+ 2 -+ 30 -+ 1 -+ 3 -+ 20 - -### Ejemplo de salida #2: - -+ 50 - -## 💡 Pista: - -+ 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/ \ No newline at end of file diff --git a/exercises/09-Two_timestamps/README.md b/exercises/09-Two_timestamps/README.md deleted file mode 100644 index 179f580f..00000000 --- a/exercises/09-Two_timestamps/README.md +++ /dev/null @@ -1,43 +0,0 @@ -# `09` Two Timestamp - -## 📝 Instructions: - -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. - -1. Calculate how many seconds passed between them. - -### Example input #1: - -+ 1 -+ 1 -+ 1 -+ 2 -+ 2 -+ 2 - -### Example output #1: - -+ 3661 - -### Example input #2: - -+ 1 -+ 2 -+ 30 -+ 1 -+ 3 -+ 20 - -### Example output #2: - -+ 50 - -## 💡 Hint: - -+ 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/ diff --git a/exercises/10-Two_digits/README.es.md b/exercises/10-Two_digits/README.es.md deleted file mode 100644 index 84387079..00000000 --- a/exercises/10-Two_digits/README.es.md +++ /dev/null @@ -1,21 +0,0 @@ -# `10` Dos dígitos - -## 📝 Instrucciones: - -1. Dado un entero de dos dígitos, 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: - -+ 79 - -### Ejemplo de salida: - -+ (7, 9) - -## 💡 Pista: - -+ 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/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 diff --git a/exercises/10-Two_digits/README.md b/exercises/10-Two_digits/README.md deleted file mode 100644 index 45ae88e5..00000000 --- a/exercises/10-Two_digits/README.md +++ /dev/null @@ -1,21 +0,0 @@ -# `10` Two Digits - -## 📝 Instructions: - -1. Given a two-digit integer, return its left digit (a tens digit) and then its right digit (a ones digit). Use the operator of integer division for obtaining the tens digit and the operator of taking remainder for obtaining the ones digit. - -### Example input: - -+ 79 - -### Example output: - -+ (7, 9) - -## 💡 Hint: - -+ 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 diff --git a/exercises/11-Swap_digits/README.es.md b/exercises/11-Swap_digits/README.es.md deleted file mode 100644 index e20becb6..00000000 --- a/exercises/11-Swap_digits/README.es.md +++ /dev/null @@ -1,27 +0,0 @@ -# `11` Intercambiar dígitos - -## 📝 Instrucciones: - -1. Crea una función llamada `swap_digits()` dado un número entero de dos dígitos, intercambia sus dígitos de posición e imprime el resultado. - -## Ejemplo de entrada: - -``` -swap_digits(79) -``` - -## Ejemplo de salida: - -``` -97 -``` - -## 💡 Pista: - -+ 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/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 str(num). - -+ El valor a retornar debe ser un número entero.