From b54be8bdb5cb4a6a38360bb7ebcb39f174780309 Mon Sep 17 00:00:00 2001 From: Nikolay Gagarinov Date: Tue, 4 Aug 2026 22:57:36 +0500 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20=D0=B0=D0=BD=D0=B3=D0=BB=D0=B8=D0=B9?= =?UTF-8?q?=D1=81=D0=BA=D0=B8=D0=B9=20=D0=BA=D0=B0=D0=BA=20=D0=BD=D0=B5?= =?UTF-8?q?=D0=B9=D1=82=D1=80=D0=B0=D0=BB=D1=8C=D0=BD=D1=8B=D0=B9=20=D1=8F?= =?UTF-8?q?=D0=B7=D1=8B=D0=BA=20=D0=B2=20=D0=B7=D0=B0=D0=B4=D0=B0=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F=D1=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Файлы решения и теста в CB — общие на все локали, поэтому русская строка внутри них ломает нерусские локали: тест сверял русский оригинал, а задание на es/en велело студенту вывести переведённый текст. Печатаемые и проверяемые строки, а также комментарии-подсказки переведены на английский; в условиях всех трёх локалей код-примеры приведены к тому же тексту. Проза осталась на языке локали. Английские строки совпадают с теми, что уже приняты в exercises-php, чтобы одинаковые уроки не расходились между языками. Проверено: pytest по всем 69 упражнениям зелёный. --- modules/10-basics/20-comments/en/EXERCISE.md | 9 +++++++- modules/10-basics/20-comments/es/EXERCISE.md | 9 +++++++- modules/10-basics/20-comments/ru/EXERCISE.md | 2 +- modules/10-basics/20-comments/solution.py | 2 +- .../10-basics/20-comments/test_solution.py | 2 +- .../10-basics/30-instructions/en/EXERCISE.md | 10 ++++----- .../10-basics/30-instructions/es/EXERCISE.md | 10 ++++----- .../10-basics/30-instructions/ru/EXERCISE.md | 6 +++--- modules/10-basics/30-instructions/solution.py | 6 +++--- .../30-instructions/test_solution.py | 2 +- .../10-basics/50-syntax-errors/en/EXERCISE.md | 14 ++++++++----- .../10-basics/50-syntax-errors/es/EXERCISE.md | 14 ++++++++----- .../10-basics/50-syntax-errors/ru/EXERCISE.md | 2 +- .../10-basics/50-syntax-errors/solution.py | 2 +- .../50-syntax-errors/test_solution.py | 2 +- .../15-escape-characters/en/EXERCISE.md | 8 +++---- .../15-escape-characters/es/EXERCISE.md | 9 ++++---- .../15-escape-characters/ru/EXERCISE.md | 4 ++-- .../15-escape-characters/solution.py | 2 +- .../15-escape-characters/test_solution.py | 2 +- modules/30-variables/12-change/en/EXERCISE.md | 11 ++++++++-- modules/30-variables/12-change/es/EXERCISE.md | 11 ++++++++-- modules/30-variables/12-change/ru/EXERCISE.md | 2 +- modules/30-variables/12-change/solution.py | 4 ++-- .../30-variables/12-change/test_solution.py | 2 +- .../18-variable-concatenation/en/EXERCISE.md | 19 +++++++---------- .../18-variable-concatenation/es/EXERCISE.md | 19 +++++++---------- .../18-variable-concatenation/ru/EXERCISE.md | 6 +++--- .../18-variable-concatenation/solution.py | 8 +++---- .../test_solution.py | 6 +++--- .../20-magic-numbers/en/EXERCISE.md | 21 +++++++------------ .../20-magic-numbers/es/EXERCISE.md | 21 +++++++------------ .../20-magic-numbers/ru/EXERCISE.md | 4 ++-- .../30-variables/20-magic-numbers/solution.py | 2 +- .../20-magic-numbers/test_solution.py | 2 +- .../25-interpolation/en/EXERCISE.md | 5 +++-- .../25-interpolation/es/EXERCISE.md | 5 +++-- .../25-interpolation/ru/EXERCISE.md | 2 +- .../25-interpolation/solution.py | 4 ++-- .../25-interpolation/test_solution.py | 2 +- .../90-multiline-strings/en/EXERCISE.md | 11 +++++----- .../90-multiline-strings/es/EXERCISE.md | 11 +++++----- .../90-multiline-strings/ru/EXERCISE.md | 8 +++---- .../90-multiline-strings/solution.py | 8 +++---- .../90-multiline-strings/test_solution.py | 8 +++---- .../solution.py | 8 +++---- .../45-logic/15-bool-strings/test_solution.py | 6 +++--- 47 files changed, 174 insertions(+), 159 deletions(-) diff --git a/modules/10-basics/20-comments/en/EXERCISE.md b/modules/10-basics/20-comments/en/EXERCISE.md index 1eacaab6..1d4a6ef2 100644 --- a/modules/10-basics/20-comments/en/EXERCISE.md +++ b/modules/10-basics/20-comments/en/EXERCISE.md @@ -1,2 +1,9 @@ +You are writing a program and realize that one part needs to be finished later. To avoid forgetting, programmers leave themselves notes right in the code — TODO comments. -Create a one-line comment with the text: `You know nothing, Jon Snow!` +Add the following comment to the file: + +```python +# TODO: add a greeting function +``` + +When you come back to this place later, the comment will remind you that there is still unfinished work here. diff --git a/modules/10-basics/20-comments/es/EXERCISE.md b/modules/10-basics/20-comments/es/EXERCISE.md index 5474cebc..d8dbe5af 100644 --- a/modules/10-basics/20-comments/es/EXERCISE.md +++ b/modules/10-basics/20-comments/es/EXERCISE.md @@ -1,2 +1,9 @@ +Estás escribiendo un programa y te das cuenta de que una parte hay que terminarla más tarde. Para no olvidarlo, los programadores se dejan notas directamente en el código — los comentarios TODO. -Crea un comentario de una línea con el texto: `You know nothing, Jon Snow!` +Agrega al archivo el siguiente comentario: + +```python +# TODO: add a greeting function +``` + +Cuando vuelvas a este lugar más tarde, el comentario te recordará que aquí todavía hay trabajo sin terminar. diff --git a/modules/10-basics/20-comments/ru/EXERCISE.md b/modules/10-basics/20-comments/ru/EXERCISE.md index 0d6ec50d..818383d6 100644 --- a/modules/10-basics/20-comments/ru/EXERCISE.md +++ b/modules/10-basics/20-comments/ru/EXERCISE.md @@ -3,7 +3,7 @@ Добавьте в файл такой комментарий: ```python -# TODO: добавить функцию приветствия +# TODO: add a greeting function ``` Когда вернётесь к этому месту позже, комментарий напомнит, что здесь ещё есть незавершённая работа. diff --git a/modules/10-basics/20-comments/solution.py b/modules/10-basics/20-comments/solution.py index b0133822..c6ec5113 100644 --- a/modules/10-basics/20-comments/solution.py +++ b/modules/10-basics/20-comments/solution.py @@ -1 +1 @@ -# TODO: добавить функцию приветствия +# TODO: add a greeting function diff --git a/modules/10-basics/20-comments/test_solution.py b/modules/10-basics/20-comments/test_solution.py index 093643f0..80438011 100644 --- a/modules/10-basics/20-comments/test_solution.py +++ b/modules/10-basics/20-comments/test_solution.py @@ -1,5 +1,5 @@ def test(): with open("solution.py") as file: comment = file.read().rstrip() - assert comment == "# TODO: добавить функцию приветствия" + assert comment == "# TODO: add a greeting function" print(comment) diff --git a/modules/10-basics/30-instructions/en/EXERCISE.md b/modules/10-basics/30-instructions/en/EXERCISE.md index 10513654..5c085eec 100644 --- a/modules/10-basics/30-instructions/en/EXERCISE.md +++ b/modules/10-basics/30-instructions/en/EXERCISE.md @@ -1,9 +1,7 @@ -Display three names, one after another: _Robert_, _Stannis_, _Renly_. The result should be that the following is shown on the screen: +Print the delivery status of a parcel to the screen — three lines, each with a separate `print()` call: ```text -Robert -Stannis -Renly +Order #1337 +Status: in delivery +Estimated time: 2 days ``` - -For each name, use Python's own `print()` call. diff --git a/modules/10-basics/30-instructions/es/EXERCISE.md b/modules/10-basics/30-instructions/es/EXERCISE.md index 6c8cb2d5..b9255821 100644 --- a/modules/10-basics/30-instructions/es/EXERCISE.md +++ b/modules/10-basics/30-instructions/es/EXERCISE.md @@ -1,9 +1,7 @@ -Imprime en la pantalla uno tras otro tres nombres: *Robert*, *Stannis*, *Renly*. Como resultado, se debe mostrar en la pantalla: +Muestra en pantalla el estado de entrega de un paquete: tres líneas, cada una con su propia llamada a `print()`: ```text -Robert -Stannis -Renly +Order #1337 +Status: in delivery +Estimated time: 2 days ``` - -Por cada nombre o designación, usa nuevamente la orden de `print()`. diff --git a/modules/10-basics/30-instructions/ru/EXERCISE.md b/modules/10-basics/30-instructions/ru/EXERCISE.md index 981e0b0d..ce4b9042 100644 --- a/modules/10-basics/30-instructions/ru/EXERCISE.md +++ b/modules/10-basics/30-instructions/ru/EXERCISE.md @@ -1,7 +1,7 @@ Выведите на экран статус доставки посылки — три строки, каждая отдельным вызовом `print()`: ```text -Заказ №1337 -Статус: доставляется -Примерный срок: 2 дня +Order #1337 +Status: in delivery +Estimated time: 2 days ``` diff --git a/modules/10-basics/30-instructions/solution.py b/modules/10-basics/30-instructions/solution.py index c531c74d..a9e729d4 100644 --- a/modules/10-basics/30-instructions/solution.py +++ b/modules/10-basics/30-instructions/solution.py @@ -1,3 +1,3 @@ -print("Заказ №1337") -print("Статус: доставляется") -print("Примерный срок: 2 дня") +print("Order #1337") +print("Status: in delivery") +print("Estimated time: 2 days") diff --git a/modules/10-basics/30-instructions/test_solution.py b/modules/10-basics/30-instructions/test_solution.py index 3c2803a9..13457dfc 100644 --- a/modules/10-basics/30-instructions/test_solution.py +++ b/modules/10-basics/30-instructions/test_solution.py @@ -2,7 +2,7 @@ def test(capsys): - expected = "Заказ №1337\nСтатус: доставляется\nПримерный срок: 2 дня" + expected = "Order #1337\nStatus: in delivery\nEstimated time: 2 days" expect_output(capsys, expected) diff --git a/modules/10-basics/50-syntax-errors/en/EXERCISE.md b/modules/10-basics/50-syntax-errors/en/EXERCISE.md index 29f94f0f..5781caa1 100644 --- a/modules/10-basics/50-syntax-errors/en/EXERCISE.md +++ b/modules/10-basics/50-syntax-errors/en/EXERCISE.md @@ -1,8 +1,12 @@ - -This assignment is not directly related to the lesson. But it will be useful to practice with the output on the screen. - -Display: +The program runs and reports the result. Write a program that prints: ```text -What Is Dead May Never Die +Program started successfully ``` + +Once the program works, break it on purpose — make one of the syntax errors: + +- remove the closing quote; +- remove the closing parenthesis. + +Run the code and read the Python message. You will see such messages often, so it is important to learn to read them. Then restore the working version so that the exercise passes the check. diff --git a/modules/10-basics/50-syntax-errors/es/EXERCISE.md b/modules/10-basics/50-syntax-errors/es/EXERCISE.md index 806cd335..89272328 100644 --- a/modules/10-basics/50-syntax-errors/es/EXERCISE.md +++ b/modules/10-basics/50-syntax-errors/es/EXERCISE.md @@ -1,8 +1,12 @@ - -Esta tarea no está directamente relacionada con la lección. Pero será útil practicar la impresión en la pantalla. - -Imprime en la pantalla: +El programa se ejecuta e informa del resultado. Escribe un programa que muestre: ```text -What Is Dead May Never Die +Program started successfully ``` + +Una vez que el programa funcione, rómpelo a propósito: comete uno de los errores de sintaxis: + +- quita la comilla de cierre; +- quita el paréntesis de cierre. + +Ejecuta el código y lee el mensaje de Python. Verás estos mensajes con frecuencia: es importante aprender a leerlos. Después, vuelve a la versión que funciona para que el ejercicio pase la comprobación. diff --git a/modules/10-basics/50-syntax-errors/ru/EXERCISE.md b/modules/10-basics/50-syntax-errors/ru/EXERCISE.md index 804ed7fc..a4097738 100644 --- a/modules/10-basics/50-syntax-errors/ru/EXERCISE.md +++ b/modules/10-basics/50-syntax-errors/ru/EXERCISE.md @@ -1,7 +1,7 @@ Программа запускается и сообщает о результате. Напишите программу, которая выводит: ```text -Программа успешно запущена +Program started successfully ``` После того как программа заработает, намеренно сломайте её — допустите одну из синтаксических ошибок: diff --git a/modules/10-basics/50-syntax-errors/solution.py b/modules/10-basics/50-syntax-errors/solution.py index c9cadacd..cbb41085 100644 --- a/modules/10-basics/50-syntax-errors/solution.py +++ b/modules/10-basics/50-syntax-errors/solution.py @@ -1 +1 @@ -print("Программа успешно запущена") +print("Program started successfully") diff --git a/modules/10-basics/50-syntax-errors/test_solution.py b/modules/10-basics/50-syntax-errors/test_solution.py index 22e7cb98..8b862026 100644 --- a/modules/10-basics/50-syntax-errors/test_solution.py +++ b/modules/10-basics/50-syntax-errors/test_solution.py @@ -2,7 +2,7 @@ def test(capsys): - expected = "Программа успешно запущена" + expected = "Program started successfully" expect_output(capsys, expected) diff --git a/modules/25-strings/15-escape-characters/en/EXERCISE.md b/modules/25-strings/15-escape-characters/en/EXERCISE.md index c8fabca5..8f301801 100644 --- a/modules/25-strings/15-escape-characters/en/EXERCISE.md +++ b/modules/25-strings/15-escape-characters/en/EXERCISE.md @@ -1,8 +1,8 @@ -Write a program that displays on this the screen: +You are writing a program that shows the user a tip about how to split text into lines. Print the tip with a single `print()` call: ```text -- Did Joffrey agree? -- He did. He also said "I love using \n". +Use "\n" to separate lines +Example: print("line1\nline2") ``` -This program should have only one `print()`, but the result on the screen should look exactly like the one shown above. +Note: the `\n` in the first line is literal text, not a line break. diff --git a/modules/25-strings/15-escape-characters/es/EXERCISE.md b/modules/25-strings/15-escape-characters/es/EXERCISE.md index 6c2971a5..8a02beb0 100644 --- a/modules/25-strings/15-escape-characters/es/EXERCISE.md +++ b/modules/25-strings/15-escape-characters/es/EXERCISE.md @@ -1,9 +1,8 @@ - -Escribe un programa que muestre en pantalla: +Estás escribiendo un programa que le muestra al usuario una pista sobre cómo dividir el texto en líneas. Muestra la pista con una sola llamada a `print()`: ```text -- Did Joffrey agree? -- He did. He also said "I love using \n". +Use "\n" to separate lines +Example: print("line1\nline2") ``` -El programa debe utilizar solo una llamada a `print()`, pero el resultado en pantalla debe ser exactamente como se muestra arriba. +Ten en cuenta: el `\n` de la primera línea es texto literal, no un salto de línea. diff --git a/modules/25-strings/15-escape-characters/ru/EXERCISE.md b/modules/25-strings/15-escape-characters/ru/EXERCISE.md index a97825f8..f439cb3b 100644 --- a/modules/25-strings/15-escape-characters/ru/EXERCISE.md +++ b/modules/25-strings/15-escape-characters/ru/EXERCISE.md @@ -1,8 +1,8 @@ Вы пишете программу, которая показывает пользователю подсказку о том, как разбить текст на строки. Выведите подсказку одним вызовом `print()`: ```text -Для разделения строк используйте "\n" -Пример: print("строка1\nстрока2") +Use "\n" to separate lines +Example: print("line1\nline2") ``` Обратите внимание: `\n` в первой строке — это буквальный текст, а не перевод строки. diff --git a/modules/25-strings/15-escape-characters/solution.py b/modules/25-strings/15-escape-characters/solution.py index c90d9bf5..b8e4c44b 100644 --- a/modules/25-strings/15-escape-characters/solution.py +++ b/modules/25-strings/15-escape-characters/solution.py @@ -1 +1 @@ -print('Для разделения строк используйте "\\n"\nПример: print("строка1\\nстрока2")') +print('Use "\\n" to separate lines\nExample: print("line1\\nline2")') diff --git a/modules/25-strings/15-escape-characters/test_solution.py b/modules/25-strings/15-escape-characters/test_solution.py index 9e5bd47e..0aaff56e 100644 --- a/modules/25-strings/15-escape-characters/test_solution.py +++ b/modules/25-strings/15-escape-characters/test_solution.py @@ -2,7 +2,7 @@ def test(capsys): - expected = 'Для разделения строк используйте "\\n"\nПример: print("строка1\\nстрока2")' + expected = 'Use "\\n" to separate lines\nExample: print("line1\\nline2")' expect_output(capsys, expected) diff --git a/modules/30-variables/12-change/en/EXERCISE.md b/modules/30-variables/12-change/en/EXERCISE.md index fa87dca3..5dc28e29 100644 --- a/modules/30-variables/12-change/en/EXERCISE.md +++ b/modules/30-variables/12-change/en/EXERCISE.md @@ -1,4 +1,11 @@ +The status of an order is updated as it moves along. At first the order is `"in transit"`, then it changes to `"delivered"`. -In the exercise, a variable is defined with a string inside it. Override the value of this variable and assign it a string in which the characters of the original string are arranged in reverse order. +The exercise defines a variable `delivery_status` with the value `"in transit"`. Reassign its value to `"delivered"` and print it to the screen. -Note: in this assignment, you'll have to write code between lines with comments `# BEGIN` and `# END` (we mentioned it before, but this is the first time you've come across this format). +An example of reassigning a variable: + +```python +some_var = 'old value' +some_var = 'new value' +print(some_var) # => new value +``` diff --git a/modules/30-variables/12-change/es/EXERCISE.md b/modules/30-variables/12-change/es/EXERCISE.md index f78c7d6c..91650888 100644 --- a/modules/30-variables/12-change/es/EXERCISE.md +++ b/modules/30-variables/12-change/es/EXERCISE.md @@ -1,4 +1,11 @@ +El estado de un pedido se actualiza a medida que avanza. Al principio el pedido está `"in transit"`, luego pasa al estado `"delivered"`. -En este ejercicio se define una variable que contiene una cadena de texto. Reasigne el valor de esta variable y asígnele una cadena de texto en la que los caracteres de la cadena original estén en orden inverso. +En el ejercicio se define una variable `delivery_status` con el valor `"in transit"`. Reasigna su valor a `"delivered"` y muéstralo en pantalla. -Tenga en cuenta: en este ejercicio, deberá escribir código entre las líneas de comentarios `# BEGIN` y `# END` (esto se mencionó anteriormente, pero esta es la primera vez que se encuentra con este formato). +Ejemplo de reasignación de una variable: + +```python +some_var = 'valor antiguo' +some_var = 'valor nuevo' +print(some_var) # => valor nuevo +``` diff --git a/modules/30-variables/12-change/ru/EXERCISE.md b/modules/30-variables/12-change/ru/EXERCISE.md index 78f7c853..bc384ce1 100644 --- a/modules/30-variables/12-change/ru/EXERCISE.md +++ b/modules/30-variables/12-change/ru/EXERCISE.md @@ -1,6 +1,6 @@ Статус заказа обновляется по мере его продвижения. В начале заказ находится «в пути», затем переходит в статус «доставлен». -В упражнении определена переменная `delivery_status` со значением `"в пути"`. Переопределите ее значение на `"доставлен"` и выведите на экран. +В упражнении определена переменная `delivery_status` со значением `"in transit"`. Переопределите ее значение на `"delivered"` и выведите на экран. Пример переопределения переменной: diff --git a/modules/30-variables/12-change/solution.py b/modules/30-variables/12-change/solution.py index 1d9a8f06..270dad62 100644 --- a/modules/30-variables/12-change/solution.py +++ b/modules/30-variables/12-change/solution.py @@ -1,7 +1,7 @@ -delivery_status = "в пути" +delivery_status = "in transit" # BEGIN -delivery_status = "доставлен" +delivery_status = "delivered" # END print(delivery_status) diff --git a/modules/30-variables/12-change/test_solution.py b/modules/30-variables/12-change/test_solution.py index c4b5b337..8e2a2ed6 100644 --- a/modules/30-variables/12-change/test_solution.py +++ b/modules/30-variables/12-change/test_solution.py @@ -2,7 +2,7 @@ def test(capsys): - expected = "доставлен" + expected = "delivered" expect_output(capsys, expected) diff --git a/modules/30-variables/18-variable-concatenation/en/EXERCISE.md b/modules/30-variables/18-variable-concatenation/en/EXERCISE.md index 755c7ed3..212286d6 100644 --- a/modules/30-variables/18-variable-concatenation/en/EXERCISE.md +++ b/modules/30-variables/18-variable-concatenation/en/EXERCISE.md @@ -1,18 +1,15 @@ +An online store sends the customer an email after the order is placed. The email is generated automatically from the customer's data. -Websites are constantly sending emails to their users. A common task is to automatically send a personalized email with the user's name in the header. If a database stores people's names, the task of generating the header boils down to concatenation: for example, you want to glue the string `Hello` with a string containing a user's name. +Write a program that builds the greeting and the body of the email using the variables that are already provided, and prints the lines to the screen. -Write a program that will create the header and body of an email using ready-made variables and print the resulting strings. +For the greeting, use the variables `first_name` and `greeting`, a comma and an exclamation mark. For the body, use the variables `intro` and `info` — the second sentence must be on a new line. -Use the `first_name` and `greeting`, variables, a comma, and an exclamation point for the header. Print it in the correct order. - -Use the variables `info` and `intro` for the body of the message, with the second sentence on a new line. - -The result should look like this: +The result on the screen: ```text -Hello, Joffrey! -Here is important information about your account security. -We couldn't verify your mother's maiden name. +Hello, Anna! +Thank you for your order. +Estimated delivery date — 3 business days. ``` -Perform the task using only two `print()` statements. +Complete the task using only two `print()` calls. diff --git a/modules/30-variables/18-variable-concatenation/es/EXERCISE.md b/modules/30-variables/18-variable-concatenation/es/EXERCISE.md index a7885b27..226aa3bf 100644 --- a/modules/30-variables/18-variable-concatenation/es/EXERCISE.md +++ b/modules/30-variables/18-variable-concatenation/es/EXERCISE.md @@ -1,18 +1,15 @@ +Una tienda en línea le envía al comprador un correo electrónico después de realizar el pedido. El correo se genera automáticamente a partir de los datos del cliente. -Los sitios web envían constantemente correos electrónicos a sus usuarios. Una tarea típica es enviar automáticamente un correo electrónico personalizado, donde el nombre del usuario estará en el encabezado. Si el nombre de la persona se almacena en algún lugar de la base de datos del sitio como una cadena, la tarea de generar el encabezado se reduce a la concatenación: por ejemplo, es necesario unir la cadena `Hola` con la cadena que contiene el nombre. +Escribe un programa que genere el saludo y el cuerpo del correo utilizando las variables ya proporcionadas, y muestre las cadenas en la pantalla. -Escriba un programa que genere el encabezado y el cuerpo del correo electrónico, utilizando variables ya definidas, y muestre las cadenas resultantes en la pantalla. +Para el saludo, utiliza las variables `first_name` y `greeting`, una coma y un signo de exclamación. Para el cuerpo del correo, utiliza las variables `intro` e `info`: la segunda oración debe estar en una nueva línea. -Para el encabezado, use las variables `first_name` y `greeting`, seguidas de una coma y un signo de exclamación. Muestre esto en la pantalla en el orden correcto. - -Para el cuerpo del correo electrónico, use las variables `info` e `intro`, y asegúrese de que la segunda oración esté en una nueva línea. - -El resultado en la pantalla se verá así: +El resultado en la pantalla: ```text -Hello, Joffrey! -Here is important information about your account security. -We couldn't verify your mother's maiden name. +Hello, Anna! +Thank you for your order. +Estimated delivery date — 3 business days. ``` -Complete la tarea utilizando solo dos `print()`. +Completa la tarea utilizando solamente dos llamadas a `print()`. diff --git a/modules/30-variables/18-variable-concatenation/ru/EXERCISE.md b/modules/30-variables/18-variable-concatenation/ru/EXERCISE.md index c79433e5..ccb189c8 100644 --- a/modules/30-variables/18-variable-concatenation/ru/EXERCISE.md +++ b/modules/30-variables/18-variable-concatenation/ru/EXERCISE.md @@ -7,9 +7,9 @@ Результат на экране: ```text -Здравствуйте, Анна! -Спасибо за ваш заказ. -Ожидаемая дата доставки — 3 рабочих дня. +Hello, Anna! +Thank you for your order. +Estimated delivery date — 3 business days. ``` Выполните задание, используя только два `print()`. diff --git a/modules/30-variables/18-variable-concatenation/solution.py b/modules/30-variables/18-variable-concatenation/solution.py index fe4ce645..7cc6afe7 100644 --- a/modules/30-variables/18-variable-concatenation/solution.py +++ b/modules/30-variables/18-variable-concatenation/solution.py @@ -1,7 +1,7 @@ -first_name = "Анна" -greeting = "Здравствуйте" -intro = "Спасибо за ваш заказ." -info = "Ожидаемая дата доставки — 3 рабочих дня." +first_name = "Anna" +greeting = "Hello" +intro = "Thank you for your order." +info = "Estimated delivery date — 3 business days." # BEGIN print(greeting + ", " + first_name + "!") diff --git a/modules/30-variables/18-variable-concatenation/test_solution.py b/modules/30-variables/18-variable-concatenation/test_solution.py index 16485df3..3f6b4f29 100644 --- a/modules/30-variables/18-variable-concatenation/test_solution.py +++ b/modules/30-variables/18-variable-concatenation/test_solution.py @@ -2,9 +2,9 @@ def test(capsys): - expected = """Здравствуйте, Анна! -Спасибо за ваш заказ. -Ожидаемая дата доставки — 3 рабочих дня.""" + expected = """Hello, Anna! +Thank you for your order. +Estimated delivery date — 3 business days.""" expect_output(capsys, expected) diff --git a/modules/30-variables/20-magic-numbers/en/EXERCISE.md b/modules/30-variables/20-magic-numbers/en/EXERCISE.md index c6835950..199f321a 100644 --- a/modules/30-variables/20-magic-numbers/en/EXERCISE.md +++ b/modules/30-variables/20-magic-numbers/en/EXERCISE.md @@ -1,25 +1,20 @@ - -You've come across this code, which prints the total number of rooms owned by the present king: +The warehouse received a delivery. You have come across code that counts the total number of boxes: ```python -king = "Rooms in King Balon's Castles:" -print(king) +label = "Boxes in stock:" +print(label) print(6 * 17) ``` -As you can see, there are some magic numbers here: it's unclear what 6 is and what 17 is. If you know the history of the royal family, you can guess: each new king inherits all his ancestors 'castles and builds a new one, an exact copy of his parents'. - -This strange dynasty simply breeds identical castles... - -Get rid of the magic numbers by creating new variables and then displaying the text on the screen. +The numbers 6 and 17 here are magic: it is unclear what they mean. Get rid of them by creating variables with meaningful names, and print the result to the screen. -You'll get this: +You will get this: ```text -Rooms in King Balon's Castles: +Boxes in stock: 102 ``` -The variable names should give the meaning of the numbers, but should also be short and succinct enough to be readable. +Variable names should convey the meaning of the numbers while staying short and concise. -Note: The code will work with any name, and we only check the printed result, so the task is up to you. +Remember: the code will work with any names, and the system only checks the result on the screen — completing the task properly is your responsibility. diff --git a/modules/30-variables/20-magic-numbers/es/EXERCISE.md b/modules/30-variables/20-magic-numbers/es/EXERCISE.md index 3f22afc9..e8eb6696 100644 --- a/modules/30-variables/20-magic-numbers/es/EXERCISE.md +++ b/modules/30-variables/20-magic-numbers/es/EXERCISE.md @@ -1,25 +1,20 @@ - -Te has encontrado con este código que muestra en pantalla la cantidad total de habitaciones en posesión del actual rey: +El almacén recibió una entrega. Te has encontrado con un código que cuenta la cantidad total de cajas: ```python -king = "Rooms in King Balon's Castles:" -print(king) +label = "Boxes in stock:" +print(label) print(6 * 17) ``` -Como puedes ver, estos son números mágicos: no está claro qué significa el 6 y qué significa el 17. Se puede adivinar si se conoce la historia de la familia real: cada nuevo rey hereda todos los castillos de sus antepasados y construye un nuevo castillo, que es una copia exacta del castillo de sus padres. - -Esta extraña dinastía simplemente reproduce castillos idénticos... - -Elimina los números mágicos creando nuevas variables y luego muestra el texto en pantalla. +Los números 6 y 17 aquí son mágicos: no está claro qué significan. Elimínalos creando variables con nombres comprensibles y muestra el resultado en pantalla. -El resultado debería ser: +El resultado será: ```text -Rooms in King Balon's Castles: +Boxes in stock: 102 ``` -Los nombres de las variables deben transmitir el significado de los números, pero al mismo tiempo deben ser lo suficientemente cortos y concisos para una lectura cómoda. +Los nombres de las variables deben transmitir el significado de los números, pero al mismo tiempo deben ser cortos y concisos. -Recuerda: el código funcionará con cualquier nombre, y nuestro sistema siempre verifica solamente el resultado en pantalla, por lo que completar esta tarea es tu responsabilidad. +Recuerda: el código funcionará con cualquier nombre, y el sistema solo verifica el resultado en pantalla, por lo que completar bien esta tarea es tu responsabilidad. diff --git a/modules/30-variables/20-magic-numbers/ru/EXERCISE.md b/modules/30-variables/20-magic-numbers/ru/EXERCISE.md index cd320f50..b3c910ad 100644 --- a/modules/30-variables/20-magic-numbers/ru/EXERCISE.md +++ b/modules/30-variables/20-magic-numbers/ru/EXERCISE.md @@ -1,7 +1,7 @@ Склад принял поставку. Вы столкнулись с таким кодом, который считает общее количество ящиков: ```python -label = "Ящиков на складе:" +label = "Boxes in stock:" print(label) print(6 * 17) ``` @@ -11,7 +11,7 @@ print(6 * 17) Получится так: ```text -Ящиков на складе: +Boxes in stock: 102 ``` diff --git a/modules/30-variables/20-magic-numbers/solution.py b/modules/30-variables/20-magic-numbers/solution.py index 69d93272..952fa417 100644 --- a/modules/30-variables/20-magic-numbers/solution.py +++ b/modules/30-variables/20-magic-numbers/solution.py @@ -1,4 +1,4 @@ -label = "Ящиков на складе:" +label = "Boxes in stock:" # BEGIN pallets_count = 6 diff --git a/modules/30-variables/20-magic-numbers/test_solution.py b/modules/30-variables/20-magic-numbers/test_solution.py index 505af438..91b9c11e 100644 --- a/modules/30-variables/20-magic-numbers/test_solution.py +++ b/modules/30-variables/20-magic-numbers/test_solution.py @@ -2,7 +2,7 @@ def test(capsys): - expected = "Ящиков на складе:\n102" + expected = "Boxes in stock:\n102" expect_output(capsys, expected) diff --git a/modules/31-advanced-strings/25-interpolation/en/EXERCISE.md b/modules/31-advanced-strings/25-interpolation/en/EXERCISE.md index 6a4400c1..247d8692 100644 --- a/modules/31-advanced-strings/25-interpolation/en/EXERCISE.md +++ b/modules/31-advanced-strings/25-interpolation/en/EXERCISE.md @@ -1,6 +1,7 @@ +An online store sends the customer an order confirmation. The customer name and the order number are already stored in variables — you need to substitute them into the message template with an f-string. -Print the string, `Do you want to eat, ? Where the variable`stark` should be used instead of ``. The output should look like this: +Use the variables `username` and `order_number` to print to the screen: ```text -Do you want to eat, Arya? +Hello, Anna! Your order #1337 has been accepted. ``` diff --git a/modules/31-advanced-strings/25-interpolation/es/EXERCISE.md b/modules/31-advanced-strings/25-interpolation/es/EXERCISE.md index 1d1ab095..3b8309e1 100644 --- a/modules/31-advanced-strings/25-interpolation/es/EXERCISE.md +++ b/modules/31-advanced-strings/25-interpolation/es/EXERCISE.md @@ -1,6 +1,7 @@ +Una tienda en línea envía al cliente una confirmación del pedido. El nombre del cliente y el número de pedido ya están almacenados en variables: necesitas insertarlos en la plantilla del mensaje mediante una f-string. -Imprime en pantalla la cadena `Do you want to eat, ?`, donde en lugar de `` se debe utilizar la variable `stark`. La salida debe ser la siguiente: +Usa las variables `username` y `order_number` para mostrar en pantalla: ```text -Do you want to eat, Arya? +Hello, Anna! Your order #1337 has been accepted. ``` diff --git a/modules/31-advanced-strings/25-interpolation/ru/EXERCISE.md b/modules/31-advanced-strings/25-interpolation/ru/EXERCISE.md index 26767bcc..05b06f46 100644 --- a/modules/31-advanced-strings/25-interpolation/ru/EXERCISE.md +++ b/modules/31-advanced-strings/25-interpolation/ru/EXERCISE.md @@ -3,5 +3,5 @@ Используйте переменные `username` и `order_number`, чтобы вывести на экран: ```text -Здравствуйте, Анна! Ваш заказ #1337 принят. +Hello, Anna! Your order #1337 has been accepted. ``` diff --git a/modules/31-advanced-strings/25-interpolation/solution.py b/modules/31-advanced-strings/25-interpolation/solution.py index 6a4e77cf..ed09fc30 100644 --- a/modules/31-advanced-strings/25-interpolation/solution.py +++ b/modules/31-advanced-strings/25-interpolation/solution.py @@ -1,6 +1,6 @@ -username = "Анна" +username = "Anna" order_number = 1337 # BEGIN -print(f"Здравствуйте, {username}! Ваш заказ #{order_number} принят.") +print(f"Hello, {username}! Your order #{order_number} has been accepted.") # END diff --git a/modules/31-advanced-strings/25-interpolation/test_solution.py b/modules/31-advanced-strings/25-interpolation/test_solution.py index f2a4c6de..88c9450a 100644 --- a/modules/31-advanced-strings/25-interpolation/test_solution.py +++ b/modules/31-advanced-strings/25-interpolation/test_solution.py @@ -2,7 +2,7 @@ def test(capsys): - expected = "Здравствуйте, Анна! Ваш заказ #1337 принят." + expected = "Hello, Anna! Your order #1337 has been accepted." expect_output(capsys, expected) diff --git a/modules/31-advanced-strings/90-multiline-strings/en/EXERCISE.md b/modules/31-advanced-strings/90-multiline-strings/en/EXERCISE.md index 366c3be7..359055d5 100644 --- a/modules/31-advanced-strings/90-multiline-strings/en/EXERCISE.md +++ b/modules/31-advanced-strings/90-multiline-strings/en/EXERCISE.md @@ -1,9 +1,8 @@ - -Write the text below into the `text` variable. Use triple quotes. +An online store keeps the text of the order status email in a variable and sends it to the customer. Put the email text shown below into the variable `text`. All the line breaks must be preserved. ```text -Lannister, Targaryen, Baratheon, Stark, Tyrell... -they're all just spokes on a wheel. -This one's on top, then that one's on top, and on and on it spins, -crushing those on the ground. +Dear customer! +Your order has been placed successfully. +Estimated delivery date: 3-5 business days. +Thank you for choosing us! ``` diff --git a/modules/31-advanced-strings/90-multiline-strings/es/EXERCISE.md b/modules/31-advanced-strings/90-multiline-strings/es/EXERCISE.md index 32002905..aa7a643d 100644 --- a/modules/31-advanced-strings/90-multiline-strings/es/EXERCISE.md +++ b/modules/31-advanced-strings/90-multiline-strings/es/EXERCISE.md @@ -1,9 +1,8 @@ - -Asigna el siguiente texto a la variable `text` utilizando triples comillas. +Una tienda en línea guarda en una variable el texto del correo sobre el estado del pedido y lo envía al cliente. Escribe en la variable `text` el texto del correo que aparece abajo. Todos los saltos de línea deben conservarse. ```text -Lannister, Targaryen, Baratheon, Stark, Tyrell... -they're all just spokes on a wheel. -This one's on top, then that one's on top, and on and on it spins, -crushing those on the ground. +Dear customer! +Your order has been placed successfully. +Estimated delivery date: 3-5 business days. +Thank you for choosing us! ``` diff --git a/modules/31-advanced-strings/90-multiline-strings/ru/EXERCISE.md b/modules/31-advanced-strings/90-multiline-strings/ru/EXERCISE.md index f058245b..d97e0d29 100644 --- a/modules/31-advanced-strings/90-multiline-strings/ru/EXERCISE.md +++ b/modules/31-advanced-strings/90-multiline-strings/ru/EXERCISE.md @@ -1,8 +1,8 @@ Интернет-магазин хранит текст письма о статусе заказа в переменной и отправляет его покупателю. Запишите в переменную `text` текст письма, приведённый ниже. Все переносы строк должны сохраниться. ```text -Уважаемый пользователь! -Ваш заказ успешно оформлен. -Ожидаемая дата доставки: 3-5 рабочих дней. -Спасибо, что выбрали нас! +Dear customer! +Your order has been placed successfully. +Estimated delivery date: 3-5 business days. +Thank you for choosing us! ``` diff --git a/modules/31-advanced-strings/90-multiline-strings/solution.py b/modules/31-advanced-strings/90-multiline-strings/solution.py index 07b96b7e..873b466d 100644 --- a/modules/31-advanced-strings/90-multiline-strings/solution.py +++ b/modules/31-advanced-strings/90-multiline-strings/solution.py @@ -1,8 +1,8 @@ # BEGIN -text = """Уважаемый пользователь! -Ваш заказ успешно оформлен. -Ожидаемая дата доставки: 3-5 рабочих дней. -Спасибо, что выбрали нас!""" +text = """Dear customer! +Your order has been placed successfully. +Estimated delivery date: 3-5 business days. +Thank you for choosing us!""" # END print(text) diff --git a/modules/31-advanced-strings/90-multiline-strings/test_solution.py b/modules/31-advanced-strings/90-multiline-strings/test_solution.py index a9d44b84..5c17eba8 100644 --- a/modules/31-advanced-strings/90-multiline-strings/test_solution.py +++ b/modules/31-advanced-strings/90-multiline-strings/test_solution.py @@ -2,10 +2,10 @@ def test(capsys): - expected = """Уважаемый пользователь! -Ваш заказ успешно оформлен. -Ожидаемая дата доставки: 3-5 рабочих дней. -Спасибо, что выбрали нас!""" + expected = """Dear customer! +Your order has been placed successfully. +Estimated delivery date: 3-5 business days. +Thank you for choosing us!""" expect_output(capsys, expected) diff --git a/modules/35-calling-functions/135-calling-functions-default-params/solution.py b/modules/35-calling-functions/135-calling-functions-default-params/solution.py index 2e9d25d7..287bcc87 100644 --- a/modules/35-calling-functions/135-calling-functions-default-params/solution.py +++ b/modules/35-calling-functions/135-calling-functions-default-params/solution.py @@ -1,7 +1,7 @@ -distance = 450 # расстояние, км -fuel_consumption = 8.4 # расход топлива, л/100 км -fuel_price = 64.2 # цена топлива, руб./литр -passengers = 4 # количество пассажиров +distance = 450 # distance, km +fuel_consumption = 8.4 # fuel consumption, l/100 km +fuel_price = 64.2 # fuel price per litre +passengers = 4 # number of passengers # BEGIN fuel = distance / 100 * fuel_consumption diff --git a/modules/45-logic/15-bool-strings/test_solution.py b/modules/45-logic/15-bool-strings/test_solution.py index 7bfd596d..ab5afc69 100644 --- a/modules/45-logic/15-bool-strings/test_solution.py +++ b/modules/45-logic/15-bool-strings/test_solution.py @@ -1,6 +1,6 @@ import solution def test1(): - assert not solution.is_long_word("apple") # 5 символов → False - assert solution.is_long_word("banana") # 6 символов → True - assert solution.is_long_word("pineapple") # 9 символов → True + assert not solution.is_long_word("apple") # 5 characters → False + assert solution.is_long_word("banana") # 6 characters → True + assert solution.is_long_word("pineapple") # 9 characters → True From 2ef46fc59fef4efcf61685078efe521e05fc7892 Mon Sep 17 00:00:00 2001 From: Nikolay Gagarinov Date: Tue, 4 Aug 2026 22:58:00 +0500 Subject: [PATCH 2/3] =?UTF-8?q?fix(en,es):=20=D1=80=D0=B5=D1=81=D0=B8?= =?UTF-8?q?=D0=BD=D1=85=D1=80=D0=BE=D0=BD=20=D1=83=D1=81=D1=82=D0=B0=D1=80?= =?UTF-8?q?=D0=B5=D0=B2=D1=88=D0=B8=D1=85=20=D1=83=D1=81=D0=BB=D0=BE=D0=B2?= =?UTF-8?q?=D0=B8=D0=B9=20=D1=81=20=D1=82=D0=B5=D0=BA=D1=83=D1=89=D0=B5?= =?UTF-8?q?=D0=B3=D0=BE=20ru?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Условия в en/es остались от прежней версии курса на мотивах «Игры престолов», тогда как решения и тесты давно переписаны. Из-за этого упражнения были непроходимы вне ru: например, тест ждал вывод `https://github.com/hexlet/exercises-python`, а испанское условие велело вывести `Winter came for the House of Frey.`; в `100-define-function` тест вызывал `say_hello()`, а условие описывало `print_motto()`. Условия переведены заново с текущего ru. Затронуто 18 уроков, определённых по критерию «тест сверяет строку, которая есть в ru-условии и отсутствует в es-условии» — этот критерий, в отличие от сравнения объёма или структуры, не даёт ложных срабатываний на переведённых комментариях внутри код-примеров. Уроки с уже актуальным переводом не тронуты: 30-encoding, 200-default-parameters, 350-modules, 400-packages, 45-logic/25-logical-operators. --- .../30-composition/en/EXERCISE.md | 9 +++---- .../30-composition/es/EXERCISE.md | 9 +++---- .../20-arithmetics/40-priority/en/EXERCISE.md | 8 ++++-- .../20-arithmetics/40-priority/es/EXERCISE.md | 8 ++++-- .../20-arithmetics/45-linting/en/EXERCISE.md | 7 ++++- .../20-arithmetics/45-linting/es/EXERCISE.md | 7 ++++- modules/25-strings/10-quotes/en/EXERCISE.md | 11 +++----- modules/25-strings/10-quotes/es/EXERCISE.md | 11 +++----- .../20-string-concatenation/en/EXERCISE.md | 7 +++-- .../20-string-concatenation/es/EXERCISE.md | 7 +++-- .../30-variables/10-definition/en/EXERCISE.md | 3 ++- .../30-variables/10-definition/es/EXERCISE.md | 3 ++- .../30-symbols/en/EXERCISE.md | 3 +-- .../30-symbols/es/EXERCISE.md | 3 +-- .../70-slices/en/EXERCISE.md | 3 +-- .../70-slices/es/EXERCISE.md | 3 +-- .../55-data-types-casting/en/EXERCISE.md | 15 ++++++++--- .../55-data-types-casting/es/EXERCISE.md | 15 ++++++++--- .../en/EXERCISE.md | 19 +++++++++++++- .../es/EXERCISE.md | 19 +++++++++++++- .../en/EXERCISE.md | 9 +++---- .../es/EXERCISE.md | 9 +++---- .../100-define-function/en/EXERCISE.md | 7 +++-- .../100-define-function/es/EXERCISE.md | 7 +++-- .../150-return/en/EXERCISE.md | 26 ++++++++++++++++--- .../150-return/es/EXERCISE.md | 26 ++++++++++++++++--- .../150-return/es/README.md | 2 +- .../48-conditionals/50-else-if/en/EXERCISE.md | 23 +++++++--------- .../48-conditionals/50-else-if/es/EXERCISE.md | 21 +++++++-------- 29 files changed, 192 insertions(+), 108 deletions(-) diff --git a/modules/20-arithmetics/30-composition/en/EXERCISE.md b/modules/20-arithmetics/30-composition/en/EXERCISE.md index 07cb1bef..674d3e34 100644 --- a/modules/20-arithmetics/30-composition/en/EXERCISE.md +++ b/modules/20-arithmetics/30-composition/en/EXERCISE.md @@ -1,8 +1,7 @@ - -Write a program that calculates and prints the value of this expression: +You are going to a store to buy gifts: 3 books at 200 each and 2 pens at 30 each. Calculate and print the total cost of the purchase. ```text -8 / 2 + 5 - -3 / 2 +3 * 200 + 2 * 30 + ↓ ↓ + 600 + 60 = 660 ``` - -Don't calculate anything manually, your program should do all the calculations on its own. diff --git a/modules/20-arithmetics/30-composition/es/EXERCISE.md b/modules/20-arithmetics/30-composition/es/EXERCISE.md index 190de770..387c953f 100644 --- a/modules/20-arithmetics/30-composition/es/EXERCISE.md +++ b/modules/20-arithmetics/30-composition/es/EXERCISE.md @@ -1,8 +1,7 @@ - -Implementa un programa que calcule y muestre en pantalla el valor de la expresión: +Vas a una tienda a comprar regalos: 3 libros a 200 cada uno y 2 bolígrafos a 30 cada uno. Calcula y muestra en pantalla el costo total de la compra. ```text -8 / 2 + 5 - -3 / 2 +3 * 200 + 2 * 30 + ↓ ↓ + 600 + 60 = 660 ``` - -No calcules nada por tu cuenta, tu programa debe realizar todos los cálculos por sí mismo. diff --git a/modules/20-arithmetics/40-priority/en/EXERCISE.md b/modules/20-arithmetics/40-priority/en/EXERCISE.md index ef9c3cce..b7c5b106 100644 --- a/modules/20-arithmetics/40-priority/en/EXERCISE.md +++ b/modules/20-arithmetics/40-priority/en/EXERCISE.md @@ -1,4 +1,8 @@ +You and 4 friends (5 people in total) ordered 2 pizzas at 300 each and 4 drinks at 50 each. The bill has to be split equally. -The calculation is given `70 * 3 + 4 / 8 + 2`. +Write a one-line program with `print()`, placing the parentheses so that the total is calculated first and only then divided among everyone: -Place parentheses so that both additions (`3 + 4`) и (`8 + 2`) were calculated in the first place. Print the result on the screen. +```text +without parentheses: 2 * 300 + 4 * 50 / 5 = 640.0 ← wrong +with parentheses: (2 * 300 + 4 * 50) / 5 = 160.0 ← correct +``` diff --git a/modules/20-arithmetics/40-priority/es/EXERCISE.md b/modules/20-arithmetics/40-priority/es/EXERCISE.md index 8a16be6e..2e2c463b 100644 --- a/modules/20-arithmetics/40-priority/es/EXERCISE.md +++ b/modules/20-arithmetics/40-priority/es/EXERCISE.md @@ -1,4 +1,8 @@ +Tú y 4 amigos (5 personas en total) pidieron 2 pizzas a 300 cada una y 4 bebidas a 50 cada una. Hay que dividir la cuenta en partes iguales. -Dada la expresión `70 * 3 + 4 / 8 + 2`. +Escribe un programa de una sola línea con `print()`, colocando los paréntesis de modo que primero se calcule el total y solo después se divida entre todos: -Coloca paréntesis de manera que ambas sumas (`3 + 4`) y (`8 + 2`) se calculen primero. Imprime el resultado en pantalla. +```text +sin paréntesis: 2 * 300 + 4 * 50 / 5 = 640.0 ← incorrecto +con paréntesis: (2 * 300 + 4 * 50) / 5 = 160.0 ← correcto +``` diff --git a/modules/20-arithmetics/45-linting/en/EXERCISE.md b/modules/20-arithmetics/45-linting/en/EXERCISE.md index 7aae0203..f85d2c53 100644 --- a/modules/20-arithmetics/45-linting/en/EXERCISE.md +++ b/modules/20-arithmetics/45-linting/en/EXERCISE.md @@ -1,2 +1,7 @@ +You received code from a colleague — it works correctly, but it violates the PEP8 formatting standard. Fix the spaces around the operators without changing the logic: -Print the result of the following calculation: "the difference between five squared and the product of three and seven". Write the code so that each operator is separated from the operands by spaces. +```python +print( (5 **2)-(3* 7)) +``` + +The result must stay `4`. diff --git a/modules/20-arithmetics/45-linting/es/EXERCISE.md b/modules/20-arithmetics/45-linting/es/EXERCISE.md index 51a81eca..a671a2f8 100644 --- a/modules/20-arithmetics/45-linting/es/EXERCISE.md +++ b/modules/20-arithmetics/45-linting/es/EXERCISE.md @@ -1,2 +1,7 @@ +Recibiste código de un colega: funciona correctamente, pero infringe el estándar de formato PEP8. Corrige los espacios alrededor de los operadores sin cambiar la lógica: -Imprime en pantalla el resultado de la siguiente operación: "la diferencia entre cinco al cuadrado y el producto de tres por siete". Escribe el código de manera que cada operador esté separado de los operandos por espacios. +```python +print( (5 **2)-(3* 7)) +``` + +El resultado debe seguir siendo `4`. diff --git a/modules/25-strings/10-quotes/en/EXERCISE.md b/modules/25-strings/10-quotes/en/EXERCISE.md index 332a6884..4ea4ecda 100644 --- a/modules/25-strings/10-quotes/en/EXERCISE.md +++ b/modules/25-strings/10-quotes/en/EXERCISE.md @@ -1,12 +1,7 @@ - -Write a program that prints: +The program did not find the required file and printed a message with its name. Write a program that prints the same message: ```text -"Khal Drogo's favorite word is "athjahakar"" +The file "user's_config.json" was not found. ``` -The program should display this exact phrase on the screen. Note the quotes at the beginning and the end of the phrase: - -```text -"Khal Drogo's favorite word is "athjahakar"" -``` +The string contains both an apostrophe and double quotes — choose a suitable way to write it. diff --git a/modules/25-strings/10-quotes/es/EXERCISE.md b/modules/25-strings/10-quotes/es/EXERCISE.md index 7843a80f..75ccb551 100644 --- a/modules/25-strings/10-quotes/es/EXERCISE.md +++ b/modules/25-strings/10-quotes/es/EXERCISE.md @@ -1,12 +1,7 @@ - -Escribe un programa que imprima en la pantalla: +El programa no encontró el archivo necesario y mostró un mensaje con su nombre. Escribe un programa que muestre el mismo mensaje: ```text -"Khal Drogo's favorite word is "athjahakar"" +The file "user's_config.json" was not found. ``` -El programa debe imprimir exactamente esa frase. Presta atención a las comillas al principio y al final de la frase: - -```text -"Khal Drogo's favorite word is "athjahakar"" -``` +La cadena contiene tanto un apóstrofo como comillas dobles: elige la forma adecuada de escribirla. diff --git a/modules/25-strings/20-string-concatenation/en/EXERCISE.md b/modules/25-strings/20-string-concatenation/en/EXERCISE.md index b9bb9c95..256fdb1a 100644 --- a/modules/25-strings/20-string-concatenation/en/EXERCISE.md +++ b/modules/25-strings/20-string-concatenation/en/EXERCISE.md @@ -1,8 +1,7 @@ - -Display +A site builds links to user pages automatically, assembling them from separate parts. Assemble the link using concatenation and print it to the screen: ```text -Winter came for the House of Frey. +https://github.com/hexlet/exercises-python ``` -using concatenation. +Every component of the URL is a separate string: the protocol, the domain, the owner name and the repository name. diff --git a/modules/25-strings/20-string-concatenation/es/EXERCISE.md b/modules/25-strings/20-string-concatenation/es/EXERCISE.md index 48b0727f..67121e9c 100644 --- a/modules/25-strings/20-string-concatenation/es/EXERCISE.md +++ b/modules/25-strings/20-string-concatenation/es/EXERCISE.md @@ -1,8 +1,7 @@ - -Imprime en pantalla +Un sitio genera automáticamente los enlaces a las páginas de los usuarios, armándolos a partir de partes separadas. Arma el enlace mediante concatenación y muéstralo en pantalla: ```text -Winter came for the House of Frey. +https://github.com/hexlet/exercises-python ``` -utilizando la concatenación de palabras. +Cada componente de la URL es una cadena aparte: el protocolo, el dominio, el nombre del propietario y el nombre del repositorio. diff --git a/modules/30-variables/10-definition/en/EXERCISE.md b/modules/30-variables/10-definition/en/EXERCISE.md index c550f216..1450bbb5 100644 --- a/modules/30-variables/10-definition/en/EXERCISE.md +++ b/modules/30-variables/10-definition/en/EXERCISE.md @@ -1,2 +1,3 @@ +The site URL is used in several places in the program. To avoid duplicating the string, let's store it in a variable. -Create a variable named `motto` with the contents `What Is Dead May Never Die!`. Print its contents. +Create a variable `url` with the value `https://hexlet.io` and print it to the screen twice. diff --git a/modules/30-variables/10-definition/es/EXERCISE.md b/modules/30-variables/10-definition/es/EXERCISE.md index 44e85681..caff1c42 100644 --- a/modules/30-variables/10-definition/es/EXERCISE.md +++ b/modules/30-variables/10-definition/es/EXERCISE.md @@ -1,2 +1,3 @@ +La URL del sitio se usa en varios lugares del programa. Para no duplicar la cadena, la guardaremos en una variable. -Crea una variable llamada `motto` con el contenido `What Is Dead May Never Die!`. Imprime el contenido de la variable. +Crea una variable `url` con el valor `https://hexlet.io` y muéstrala en pantalla dos veces. diff --git a/modules/31-advanced-strings/30-symbols/en/EXERCISE.md b/modules/31-advanced-strings/30-symbols/en/EXERCISE.md index cf8e3929..71f9922a 100644 --- a/modules/31-advanced-strings/30-symbols/en/EXERCISE.md +++ b/modules/31-advanced-strings/30-symbols/en/EXERCISE.md @@ -1,2 +1 @@ - -Display the last character of the string in the `name` variable +A secret word is hidden in the quiz participants' names. Extract the needed characters from the variable `text` by their indexes, join them and print the word `grip` to the screen. diff --git a/modules/31-advanced-strings/30-symbols/es/EXERCISE.md b/modules/31-advanced-strings/30-symbols/es/EXERCISE.md index ca0a1bc2..30700121 100644 --- a/modules/31-advanced-strings/30-symbols/es/EXERCISE.md +++ b/modules/31-advanced-strings/30-symbols/es/EXERCISE.md @@ -1,2 +1 @@ - -Imprime en pantalla el último carácter de la cadena que se encuentra en la variable `name`. +En los nombres de los participantes del quiz se esconde una palabra secreta. Extrae los caracteres necesarios de la variable `text` por sus índices, únelos y muestra en pantalla la palabra `grip`. diff --git a/modules/31-advanced-strings/70-slices/en/EXERCISE.md b/modules/31-advanced-strings/70-slices/en/EXERCISE.md index 1b390ae6..247e552d 100644 --- a/modules/31-advanced-strings/70-slices/en/EXERCISE.md +++ b/modules/31-advanced-strings/70-slices/en/EXERCISE.md @@ -1,2 +1 @@ - -The variable `value` contains the value `Hexlet`. Extract from it and display the slice that gets the substring `xle`. This task can be done in different ways. +The program receives a full site address and has to pick out only the domain name — without the `https://` protocol. The variable `url` holds the address `https://hexlet.io`. Use a slice to extract the domain name `hexlet.io` and print it to the screen. The task can be done in different ways. diff --git a/modules/31-advanced-strings/70-slices/es/EXERCISE.md b/modules/31-advanced-strings/70-slices/es/EXERCISE.md index e12fbcc0..59db1500 100644 --- a/modules/31-advanced-strings/70-slices/es/EXERCISE.md +++ b/modules/31-advanced-strings/70-slices/es/EXERCISE.md @@ -1,2 +1 @@ - -La variable `value` contiene el valor `Hexlet`. Extrae y muestra en pantalla un recorte que obtenga la subcadena `xle` de ella. Puedes hacer esto de diferentes maneras. +El programa recibe la dirección completa de un sitio y debe extraer de ella solo el nombre del dominio, sin el protocolo `https://`. La variable `url` contiene la dirección `https://hexlet.io`. Extrae con un corte (slice) el nombre de dominio `hexlet.io` y muéstralo en pantalla. La tarea se puede resolver de distintas maneras. diff --git a/modules/33-data-types/55-data-types-casting/en/EXERCISE.md b/modules/33-data-types/55-data-types-casting/en/EXERCISE.md index d612c555..b6cd60d3 100644 --- a/modules/33-data-types/55-data-types-casting/en/EXERCISE.md +++ b/modules/33-data-types/55-data-types-casting/en/EXERCISE.md @@ -1,6 +1,15 @@ +A thermometer shows the temperature with a decimal point. The program has to print only the whole value with a label. -Output the string `2 times` obtained from the number 2.9 (stored in the variable `value`) and the string `times` using type conversions and concatenation. To do this, perform two conversions: first to an integer and then to a string +You have a variable: -```text -2 times +```python +temperature = 36.6 ``` + +Write a program that: + +1. Converts the temperature to an integer. +2. Turns the resulting number into a string. +3. Prints that string to the screen, adding the label `°C` after a space. + +Use the `int()` and `str()` functions. diff --git a/modules/33-data-types/55-data-types-casting/es/EXERCISE.md b/modules/33-data-types/55-data-types-casting/es/EXERCISE.md index 70faa6b0..7ecae9fd 100644 --- a/modules/33-data-types/55-data-types-casting/es/EXERCISE.md +++ b/modules/33-data-types/55-data-types-casting/es/EXERCISE.md @@ -1,6 +1,15 @@ +Un termómetro muestra la temperatura con punto decimal. El programa debe mostrar solo el valor entero con una etiqueta. -Imprime en la pantalla la cadena de texto `2 times`, obtenida a partir del número 2.9 (almacenado en la variable `value`) y la cadena de texto `times`, utilizando conversiones de tipos y concatenación. Para lograrlo, debes realizar dos conversiones: primero a un número entero y luego a una cadena de texto. +Tienes una variable: -```text -2 times +```python +temperature = 36.6 ``` + +Escribe un programa que: + +1. Convierta la temperatura en un número entero. +2. Transforme el número obtenido en una cadena. +3. Muestre esa cadena en pantalla, añadiendo la etiqueta `°C` después de un espacio. + +Usa las funciones `int()` y `str()`. diff --git a/modules/35-calling-functions/135-calling-functions-default-params/en/EXERCISE.md b/modules/35-calling-functions/135-calling-functions-default-params/en/EXERCISE.md index bd19cc26..3119bf18 100644 --- a/modules/35-calling-functions/135-calling-functions-default-params/en/EXERCISE.md +++ b/modules/35-calling-functions/135-calling-functions-default-params/en/EXERCISE.md @@ -1,2 +1,19 @@ +The code defines data about a car trip: the distance, the fuel consumption, the fuel price and the number of passengers. -Round up the number written in the `number` variable to two decimal places and print the result on the screen. +Calculate and print three values: + +1. The volume of fuel in litres needed for the trip. Round it to one decimal place. +2. The total cost of the trip. Round it to two decimal places. +3. The cost of the trip for each passenger. Round it to a whole number by calling `round()` without the second argument. + +Each value is printed on its own line. + +```text +distance ──────┐ + ├──→ fuel ──────┐ +fuel_consumption ──┘ ├──→ trip_cost ──────┐ + │ ├──→ per_person +fuel_price ────────────────────┘ │ + │ +passengers ─────────────────────────────────────────┘ +``` diff --git a/modules/35-calling-functions/135-calling-functions-default-params/es/EXERCISE.md b/modules/35-calling-functions/135-calling-functions-default-params/es/EXERCISE.md index 30bdb35e..1431ba35 100644 --- a/modules/35-calling-functions/135-calling-functions-default-params/es/EXERCISE.md +++ b/modules/35-calling-functions/135-calling-functions-default-params/es/EXERCISE.md @@ -1,2 +1,19 @@ +En el código se han definido datos sobre un viaje en automóvil: la distancia, el consumo de combustible, el precio del combustible y la cantidad de pasajeros. -Redondea el número almacenado en la variable `number` a dos decimales y muestra el resultado en pantalla. +Calcula y muestra en pantalla tres valores: + +1. El volumen de combustible en litros necesario para el viaje. Redondéalo a un decimal. +2. El costo total del viaje. Redondéalo a dos decimales. +3. El costo del viaje para cada pasajero. Redondéalo al número entero, llamando a `round()` sin el segundo argumento. + +Cada valor se muestra en una línea aparte. + +```text +distance ──────┐ + ├──→ fuel ──────┐ +fuel_consumption ──┘ ├──→ trip_cost ──────┐ + │ ├──→ per_person +fuel_price ────────────────────┘ │ + │ +passengers ─────────────────────────────────────────┘ +``` diff --git a/modules/35-calling-functions/150-calling-functions-expression/en/EXERCISE.md b/modules/35-calling-functions/150-calling-functions-expression/en/EXERCISE.md index 345c64b6..59d56603 100644 --- a/modules/35-calling-functions/150-calling-functions-expression/en/EXERCISE.md +++ b/modules/35-calling-functions/150-calling-functions-expression/en/EXERCISE.md @@ -1,9 +1,8 @@ - -Display the first and last letters of the sentence written in the `text` variable in the following format: +The application shows a short summary of a text: its first and last character. Print the first and the last character of the string from the variable `text` in the following format: ```text -First: N -Last: t +First: H +Last: ! ``` -Try to create only one variable to be assigned to the text to before you print it. In this lesson, we're practicing building a compound expression. +Try to create only one variable that immediately holds the required text before printing it to the screen. In this lesson we practise building a compound expression. diff --git a/modules/35-calling-functions/150-calling-functions-expression/es/EXERCISE.md b/modules/35-calling-functions/150-calling-functions-expression/es/EXERCISE.md index 283e5ccd..a6489345 100644 --- a/modules/35-calling-functions/150-calling-functions-expression/es/EXERCISE.md +++ b/modules/35-calling-functions/150-calling-functions-expression/es/EXERCISE.md @@ -1,9 +1,8 @@ - -Imprime en pantalla la primera y la última letra de la oración almacenada en la variable `texto`, en el siguiente formato: +La aplicación muestra un resumen breve de un texto: su primer y su último carácter. Muestra en pantalla el primer y el último carácter de la cadena de la variable `text` con el siguiente formato: ```text -First: N -Last: t +First: H +Last: ! ``` -Intenta crear solo una variable en la que se almacene el texto necesario antes de imprimirlo en pantalla. En esta lección, estamos practicando cómo construir una expresión compuesta. +Intenta crear una sola variable en la que se escriba de inmediato el texto necesario antes de mostrarlo en pantalla. En esta lección practicamos armar una expresión compuesta. diff --git a/modules/40-define-functions/100-define-function/en/EXERCISE.md b/modules/40-define-functions/100-define-function/en/EXERCISE.md index c97d4286..a4727931 100644 --- a/modules/40-define-functions/100-define-function/en/EXERCISE.md +++ b/modules/40-define-functions/100-define-function/en/EXERCISE.md @@ -1,8 +1,7 @@ - -Implement a function named `print_motto()` that displays the phrase *Winter is coming*. +A site prints a greeting for every visitor. Implement the function `say_hello()`, which prints the phrase `Hello, World!` to the screen. ```python -print_motto() # => Winter is coming +say_hello() # => Hello, World! ``` -In tasks where you have to implement a function, you don't need to call it. Automated tests will call this function to check if it works. The example call above is shown just to give you an idea of how your function will be used. +In tasks where you need to implement a function, you do not need to call that function. It will be called by the automated tests that check it works. The example call above is shown only so that you understand how your function will be used. diff --git a/modules/40-define-functions/100-define-function/es/EXERCISE.md b/modules/40-define-functions/100-define-function/es/EXERCISE.md index 98fc3875..e66dd3a7 100644 --- a/modules/40-define-functions/100-define-function/es/EXERCISE.md +++ b/modules/40-define-functions/100-define-function/es/EXERCISE.md @@ -1,8 +1,7 @@ - -Implementa una función llamada `print_motto()` que mostrará en la pantalla la frase *Winter is coming*. +Un sitio muestra un saludo para cada visitante. Implementa la función `say_hello()`, que muestre en pantalla la frase `Hello, World!`. ```python -print_motto() # => Winter is coming +say_hello() # => Hello, World! ``` -En los ejercicios en los que se requiere implementar una función, no es necesario llamar a esa función. Las pruebas automatizadas se encargarán de llamarla y verificar su funcionalidad. El ejemplo de llamada anterior se muestra solo para que comprendas cómo se utilizará tu función. +En las tareas en las que hay que implementar una función, no es necesario llamarla. La llamarán las pruebas automatizadas que comprueban su funcionamiento. El ejemplo de llamada de arriba se muestra solo para que entiendas cómo se usará tu función. diff --git a/modules/40-define-functions/150-return/en/EXERCISE.md b/modules/40-define-functions/150-return/en/EXERCISE.md index 6b22545b..5c66c216 100644 --- a/modules/40-define-functions/150-return/en/EXERCISE.md +++ b/modules/40-define-functions/150-return/en/EXERCISE.md @@ -1,7 +1,27 @@ +Finish the function `truncate()`, which cuts the given string down to the specified number of characters, adds an ellipsis at the end and returns the resulting string. Logic like this is often used on sites to show long text in a shortened form. -Implement the `say_hurray_three_times()` function, which returns the string 'hurray! hurray! hurray!'. +The function takes two parameters: + +1. The string that has to be cut +2. The number of characters to keep + +An example of how the function you write should behave: + +```python +# Passing the text directly +# Cutting the text down to 2 characters +truncate('hexlet', 2) # 'he...' + +# Through a variable +text = 'it works!' +# Cutting the text down to 4 characters +truncate(text, 4) # 'it w...' +``` + +The task can be solved in several ways; we will hint at just one of them. For that way you need to take a substring of the string passed as the first parameter. Use string slices for this. Based on the task, think about which index you have to extract the substring from and to: ```python -hurray = say_hurray_three_times() -print(hurray) # => hurray! hurray! hurray! +word = 'welcome!' +index = 3 +word[:index] # wel ``` diff --git a/modules/40-define-functions/150-return/es/EXERCISE.md b/modules/40-define-functions/150-return/es/EXERCISE.md index 7772a9fb..b9fbd5c8 100644 --- a/modules/40-define-functions/150-return/es/EXERCISE.md +++ b/modules/40-define-functions/150-return/es/EXERCISE.md @@ -1,7 +1,27 @@ +Completa la función `truncate()`, que recorta la cadena recibida a la cantidad indicada de caracteres, agrega puntos suspensivos al final y devuelve la cadena resultante. Esta lógica se usa a menudo en los sitios web para mostrar de forma abreviada un texto largo. -Implementa la función `say_hurray_three_times()`, que devuelve la cadena 'hurray! hurray! hurray!'. +La función recibe dos parámetros: + +1. La cadena que hay que recortar +2. La cantidad de caracteres que hay que dejar + +Un ejemplo de cómo debe funcionar la función que escribas: + +```python +# Pasamos el texto directamente +# Recortamos el texto dejando 2 caracteres +truncate('hexlet', 2) # 'he...' + +# A través de una variable +text = 'it works!' +# Recortamos el texto dejando 4 caracteres +truncate(text, 4) # 'it w...' +``` + +La tarea se puede resolver de varias maneras; te sugerimos solo una de ellas. Para resolverla así necesitas tomar una subcadena de la cadena que se pasa como primer parámetro. Usa los cortes (slices) de cadenas. Según el enunciado, piensa desde qué índice y hasta cuál debes extraer la subcadena: ```python -hurray = say_hurray_three_times() -print(hurray) # => hurray! hurray! hurray! +word = 'welcome!' +index = 3 +word[:index] # wel ``` diff --git a/modules/40-define-functions/150-return/es/README.md b/modules/40-define-functions/150-return/es/README.md index a948453a..6e03a5dd 100644 --- a/modules/40-define-functions/150-return/es/README.md +++ b/modules/40-define-functions/150-return/es/README.md @@ -86,7 +86,7 @@ Aquí no estamos devolviendo la variable en sí, sino el valor que se encuentra ```python def double_five(): - # или return 5 + 5 + # o return 5 + 5 result = 5 + 5 return result ``` diff --git a/modules/48-conditionals/50-else-if/en/EXERCISE.md b/modules/48-conditionals/50-else-if/en/EXERCISE.md index 2fef8b33..6ec84e9a 100644 --- a/modules/48-conditionals/50-else-if/en/EXERCISE.md +++ b/modules/48-conditionals/50-else-if/en/EXERCISE.md @@ -1,19 +1,16 @@ +Implement the function `get_traffic_light_action()`, which takes a traffic light colour and returns what the driver has to do. -The electronic map of Westeros that Sam implemented shows Stark allies in green circles, enemies in red, and neutral families in gray. +The rules: -Write a function `who_is_this_house_to_starks()` for Sam that takes the family name as input and returns one of three values: `'friend'`, `'enemy'`, `'neutral'`. +* `'green'` → `'go'` +* `'yellow'` → `'slow down'` +* `'red'` → `'stop'` +* Any other colour → `'unknown'` -Rules of Determination: - -* Friends (`'friend'`): `'Karstark'`, `'Tully'` -* Enemies (`'enemy'`): `'Lannister'`, `'Frey'` -* Any other families are considered `neutral'`. - -Examples of calls: +Example calls: ```python -print(who_is_this_house_to_starks('Karstark')) # => 'friend' -print(who_is_this_house_to_starks('Frey')) # => 'enemy' -print(who_is_this_house_to_starks('Joar')) # => 'neutral' -print(who_is_this_house_to_starks('Ivanov')) # => 'neutral' +print(get_traffic_light_action('green')) # => 'go' +print(get_traffic_light_action('red')) # => 'stop' +print(get_traffic_light_action('purple')) # => 'unknown' ``` diff --git a/modules/48-conditionals/50-else-if/es/EXERCISE.md b/modules/48-conditionals/50-else-if/es/EXERCISE.md index f317c2fc..59270735 100644 --- a/modules/48-conditionals/50-else-if/es/EXERCISE.md +++ b/modules/48-conditionals/50-else-if/es/EXERCISE.md @@ -1,19 +1,16 @@ +Implementa la función `get_traffic_light_action()`, que recibe el color de un semáforo y devuelve lo que debe hacer el conductor. -En el mapa electrónico de Westeros implementado por Sam, los aliados de los Stark se representan con un círculo verde, los enemigos con un círculo rojo y las familias neutrales con un círculo gris. +Las reglas: -Escribe una función para Sam llamada `who_is_this_house_to_starks()` que reciba el apellido de una familia y devuelva uno de los tres valores: `'friend'`, `'enemy'`, `'neutral'`. - -Reglas de determinación: - -* Amigos (`'friend'`): `'Karstark'`, `'Tully'` -* Enemigos (`'enemy'`): `'Lannister'`, `'Frey'` -* Todas las demás familias se consideran neutrales (`'neutral'`) +* `'green'` → `'go'` +* `'yellow'` → `'slow down'` +* `'red'` → `'stop'` +* Cualquier otro color → `'unknown'` Ejemplos de llamadas: ```python -print(who_is_this_house_to_starks('Karstark')) # => 'friend' -print(who_is_this_house_to_starks('Frey')) # => 'enemy' -print(who_is_this_house_to_starks('Joar')) # => 'neutral' -print(who_is_this_house_to_starks('Ivanov')) # => 'neutral' +print(get_traffic_light_action('green')) # => 'go' +print(get_traffic_light_action('red')) # => 'stop' +print(get_traffic_light_action('purple')) # => 'unknown' ``` From b539922bbf8baec6d7b515eb24def72599471d79 Mon Sep 17 00:00:00 2001 From: Nikolay Gagarinov Date: Tue, 4 Aug 2026 22:58:00 +0500 Subject: [PATCH 3/3] =?UTF-8?q?feat(en,es):=20=D0=B4=D0=BE=D0=B1=D0=B0?= =?UTF-8?q?=D0=B2=D0=B8=D1=82=D1=8C=20=D0=BE=D1=82=D1=81=D1=83=D1=82=D1=81?= =?UTF-8?q?=D1=82=D0=B2=D1=83=D1=8E=D1=89=D0=B8=D0=B5=20=D0=BB=D0=BE=D0=BA?= =?UTF-8?q?=D0=B0=D0=BB=D0=B8=20=D1=82=D1=80=D1=91=D1=85=20=D1=83=D0=BF?= =?UTF-8?q?=D1=80=D0=B0=D0=B6=D0=BD=D0=B5=D0=BD=D0=B8=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit У 45-logic/15-bool-strings не было ни en, ни es; у 50-loops/80-for-in-range и 50-loops/90-debug не было es. Без EXERCISE.md и data.yml эти уроки не переносятся на Хекслет вообще — синхронизатор падает на отсутствующем файле. Добавлены EXERCISE.md и data.yml. Теория (README.md) этих трёх уроков остаётся только на ru — это отдельная работа по ресинхрону теории. Попутно: в en/EXERCISE.md у 45-logic/28-logical-negation перевод утверждал `is_palindrome('hut') # true` и `is_palindrome('Argument') # true` — буквальный перевод русских «шалаш» и «Довод», которые палиндромы, тогда как английские слова ими не являются. Заменено на level/Racecar/radar. Испанская версия там корректна. --- .../45-logic/15-bool-strings/en/EXERCISE.md | 8 ++++++ modules/45-logic/15-bool-strings/en/data.yml | 2 ++ .../45-logic/15-bool-strings/es/EXERCISE.md | 8 ++++++ modules/45-logic/15-bool-strings/es/data.yml | 2 ++ .../28-logical-negation/en/EXERCISE.md | 10 +++---- .../50-loops/80-for-in-range/es/EXERCISE.md | 27 +++++++++++++++++++ modules/50-loops/80-for-in-range/es/data.yml | 4 +++ modules/50-loops/90-debug/es/EXERCISE.md | 20 ++++++++++++++ modules/50-loops/90-debug/es/data.yml | 4 +++ 9 files changed, 80 insertions(+), 5 deletions(-) create mode 100644 modules/45-logic/15-bool-strings/en/EXERCISE.md create mode 100644 modules/45-logic/15-bool-strings/en/data.yml create mode 100644 modules/45-logic/15-bool-strings/es/EXERCISE.md create mode 100644 modules/45-logic/15-bool-strings/es/data.yml create mode 100644 modules/50-loops/80-for-in-range/es/EXERCISE.md create mode 100644 modules/50-loops/80-for-in-range/es/data.yml create mode 100644 modules/50-loops/90-debug/es/EXERCISE.md create mode 100644 modules/50-loops/90-debug/es/data.yml diff --git a/modules/45-logic/15-bool-strings/en/EXERCISE.md b/modules/45-logic/15-bool-strings/en/EXERCISE.md new file mode 100644 index 00000000..a95d027e --- /dev/null +++ b/modules/45-logic/15-bool-strings/en/EXERCISE.md @@ -0,0 +1,8 @@ +When a user registers on a site, the program checks that the password is long enough — more than 5 characters. Write the function `is_long_word()`, which returns `True` if the length of the given word is greater than 5 characters, and `False` otherwise. + +An example of how it works: + +```python +print(is_long_word("apple")) # => False +print(is_long_word("banana")) # => True +``` diff --git a/modules/45-logic/15-bool-strings/en/data.yml b/modules/45-logic/15-bool-strings/en/data.yml new file mode 100644 index 00000000..7fea8d51 --- /dev/null +++ b/modules/45-logic/15-bool-strings/en/data.yml @@ -0,0 +1,2 @@ +--- +name: Comparing strings diff --git a/modules/45-logic/15-bool-strings/es/EXERCISE.md b/modules/45-logic/15-bool-strings/es/EXERCISE.md new file mode 100644 index 00000000..8a47b191 --- /dev/null +++ b/modules/45-logic/15-bool-strings/es/EXERCISE.md @@ -0,0 +1,8 @@ +Al registrarse en un sitio, el programa comprueba que la contraseña sea suficientemente larga: más de 5 caracteres. Escribe la función `is_long_word()`, que devuelve `True` si la longitud de la palabra recibida es mayor que 5 caracteres, y `False` en caso contrario. + +Un ejemplo de funcionamiento: + +```python +print(is_long_word("apple")) # => False +print(is_long_word("banana")) # => True +``` diff --git a/modules/45-logic/15-bool-strings/es/data.yml b/modules/45-logic/15-bool-strings/es/data.yml new file mode 100644 index 00000000..0ec5a11e --- /dev/null +++ b/modules/45-logic/15-bool-strings/es/data.yml @@ -0,0 +1,2 @@ +--- +name: Comparación de cadenas diff --git a/modules/45-logic/28-logical-negation/en/EXERCISE.md b/modules/45-logic/28-logical-negation/en/EXERCISE.md index 8070aaea..e7ec8df9 100644 --- a/modules/45-logic/28-logical-negation/en/EXERCISE.md +++ b/modules/45-logic/28-logical-negation/en/EXERCISE.md @@ -2,18 +2,18 @@ 1. Implement a function called `is_palindrome()` that determines whether a word is a palindrome or not. A palindrome is a word that reads the same way in both directions. Words may be passed to the function in any case, so you must first convert the word to lowercase: `word.lower()`. ```python - is_palindrome('hut') # true + is_palindrome('level') # true is_palindrome('hexlet') # false - is_palindrome('Argument') # true + is_palindrome('Racecar') # true is_palindrome('Function') # false ``` 2. Implement a function called `is_not_palindrome()` which checks if a word is NOT a palindrome: ```python - is_not_palindrome('шалаш') # false - is_not_palindrome('Ага') # false - is_not_palindrome('хекслет') # true + is_not_palindrome('radar') # false + is_not_palindrome('level') # false + is_not_palindrome('hexlet') # true ``` To do this, call `is_palindrome()` inside `is_not_palindrome()` and apply negation. diff --git a/modules/50-loops/80-for-in-range/es/EXERCISE.md b/modules/50-loops/80-for-in-range/es/EXERCISE.md new file mode 100644 index 00000000..879207bc --- /dev/null +++ b/modules/50-loops/80-for-in-range/es/EXERCISE.md @@ -0,0 +1,27 @@ +FizzBuzz es uno de los ejercicios más conocidos en las entrevistas para programadores principiantes. Se plantea para comprobar la capacidad de trabajar con bucles y condiciones. Implementa la función `fizzbuzz(n)`, que devuelve una cadena con los números del 1 al `n`. + +Con estas reglas: + +- si el número es divisible por 3, en su lugar se pone la palabra `"Fizz"`, +- si es divisible por 5, la palabra `"Buzz"`, +- si es divisible por 3 y por 5 a la vez, la palabra `"FizzBuzz"`. + +Todos los elementos deben unirse con un espacio. + +Este ejercicio aparece con frecuencia en las entrevistas para programadores, así que resulta útil saber resolverlo. + +Ejemplo de llamada a la función: + +```python +fizzbuzz(15) +# 1 2 Fizz 4 Buzz Fizz 7 8 Fizz Buzz 11 Fizz 13 14 FizzBuzz +``` + +### Algoritmo + +La tarea se puede resolver de distintas maneras. Un ejemplo de algoritmo: + +1. Declarar el elemento neutro de la agregación (una cadena vacía) +2. Usar un bucle con los números del 1 al n +3. Comprobar las condiciones de divisibilidad del número +4. Añadir el resultado de cada iteración al resultado final separándolo con un espacio. diff --git a/modules/50-loops/80-for-in-range/es/data.yml b/modules/50-loops/80-for-in-range/es/data.yml new file mode 100644 index 00000000..5fff2914 --- /dev/null +++ b/modules/50-loops/80-for-in-range/es/data.yml @@ -0,0 +1,4 @@ +--- +name: El bucle for y la función range +tips: [] +definitions: [] diff --git a/modules/50-loops/90-debug/es/EXERCISE.md b/modules/50-loops/90-debug/es/EXERCISE.md new file mode 100644 index 00000000..3c7e3ea2 --- /dev/null +++ b/modules/50-loops/90-debug/es/EXERCISE.md @@ -0,0 +1,20 @@ +Implementa la función `compress(string)`, que comprime una cadena con el método RLE (Run-Length Encoding). + +El algoritmo: si un carácter se repite varias veces seguidas, se reemplaza por el carácter y la cantidad de repeticiones. Los caracteres que aparecen una sola vez se escriben sin número. + +Ejemplos: + +```python +compress("aaabcccc") # "a3bc4" +compress("abcd") # "abcd" +compress("aabbaa") # "a2b2a2" +compress("") # "" +``` + +Este algoritmo se usa en formatos reales de compresión de datos, por ejemplo en los antiguos protocolos de fax y en los archivos BMP. + +### Algoritmo + +1. Recorrer la cadena contando la cantidad de caracteres iguales consecutivos +2. En cuanto el carácter cambie, escribir el carácter anterior y el contador (si es mayor que 1) +3. No olvidar procesar el último grupo después de terminar el bucle diff --git a/modules/50-loops/90-debug/es/data.yml b/modules/50-loops/90-debug/es/data.yml new file mode 100644 index 00000000..3bd22dc5 --- /dev/null +++ b/modules/50-loops/90-debug/es/data.yml @@ -0,0 +1,4 @@ +--- +name: Depuración +tips: [] +definitions: []