Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion modules/10-basics/20-comments/en/EXERCISE.md
Original file line number Diff line number Diff line change
@@ -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.
9 changes: 8 additions & 1 deletion modules/10-basics/20-comments/es/EXERCISE.md
Original file line number Diff line number Diff line change
@@ -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.

Check notice on line 9 in modules/10-basics/20-comments/es/EXERCISE.md

View workflow job for this annotation

GitHub Actions / LanguageTool

[LanguageTool] modules/10-basics/20-comments/es/EXERCISE.md#L9

Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN) Suggestions: `an` URL: https://languagetool.org/insights/post/indefinite-articles/ Rule: https://community.languagetool.org/rule/show/EN_A_VS_AN?lang=en-US Category: MISC
Raw output
modules/10-basics/20-comments/es/EXERCISE.md:9:10: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
 Suggestions: `an`
 URL: https://languagetool.org/insights/post/indefinite-articles/ 
 Rule: https://community.languagetool.org/rule/show/EN_A_VS_AN?lang=en-US
 Category: MISC
2 changes: 1 addition & 1 deletion modules/10-basics/20-comments/ru/EXERCISE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Добавьте в файл такой комментарий:

```python
# TODO: добавить функцию приветствия
# TODO: add a greeting function
```

Когда вернётесь к этому месту позже, комментарий напомнит, что здесь ещё есть незавершённая работа.
2 changes: 1 addition & 1 deletion modules/10-basics/20-comments/solution.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# TODO: добавить функцию приветствия
# TODO: add a greeting function
2 changes: 1 addition & 1 deletion modules/10-basics/20-comments/test_solution.py
Original file line number Diff line number Diff line change
@@ -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)
10 changes: 4 additions & 6 deletions modules/10-basics/30-instructions/en/EXERCISE.md
Original file line number Diff line number Diff line change
@@ -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.
10 changes: 4 additions & 6 deletions modules/10-basics/30-instructions/es/EXERCISE.md
Original file line number Diff line number Diff line change
@@ -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()`.
6 changes: 3 additions & 3 deletions modules/10-basics/30-instructions/ru/EXERCISE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Выведите на экран статус доставки посылки — три строки, каждая отдельным вызовом `print()`:

```text
Заказ №1337
Статус: доставляется
Примерный срок: 2 дня
Order #1337
Status: in delivery
Estimated time: 2 days
```
6 changes: 3 additions & 3 deletions modules/10-basics/30-instructions/solution.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
print("Заказ №1337")
print("Статус: доставляется")
print("Примерный срок: 2 дня")
print("Order #1337")
print("Status: in delivery")
print("Estimated time: 2 days")
2 changes: 1 addition & 1 deletion modules/10-basics/30-instructions/test_solution.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down
14 changes: 9 additions & 5 deletions modules/10-basics/50-syntax-errors/en/EXERCISE.md
Original file line number Diff line number Diff line change
@@ -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.
14 changes: 9 additions & 5 deletions modules/10-basics/50-syntax-errors/es/EXERCISE.md
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 1 addition & 1 deletion modules/10-basics/50-syntax-errors/ru/EXERCISE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Программа запускается и сообщает о результате. Напишите программу, которая выводит:

```text
Программа успешно запущена
Program started successfully
```

После того как программа заработает, намеренно сломайте её — допустите одну из синтаксических ошибок:
Expand Down
2 changes: 1 addition & 1 deletion modules/10-basics/50-syntax-errors/solution.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
print("Программа успешно запущена")
print("Program started successfully")
2 changes: 1 addition & 1 deletion modules/10-basics/50-syntax-errors/test_solution.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


def test(capsys):
expected = "Программа успешно запущена"
expected = "Program started successfully"
expect_output(capsys, expected)


Expand Down
9 changes: 4 additions & 5 deletions modules/20-arithmetics/30-composition/en/EXERCISE.md
Original file line number Diff line number Diff line change
@@ -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.
9 changes: 4 additions & 5 deletions modules/20-arithmetics/30-composition/es/EXERCISE.md
Original file line number Diff line number Diff line change
@@ -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.

Check notice on line 1 in modules/20-arithmetics/30-composition/es/EXERCISE.md

View workflow job for this annotation

GitHub Actions / LanguageTool

[LanguageTool] modules/20-arithmetics/30-composition/es/EXERCISE.md#L1

Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN) Suggestions: `an` URL: https://languagetool.org/insights/post/indefinite-articles/ Rule: https://community.languagetool.org/rule/show/EN_A_VS_AN?lang=en-US Category: MISC
Raw output
modules/20-arithmetics/30-composition/es/EXERCISE.md:1:4: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
 Suggestions: `an`
 URL: https://languagetool.org/insights/post/indefinite-articles/ 
 Rule: https://community.languagetool.org/rule/show/EN_A_VS_AN?lang=en-US
 Category: MISC

```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.
8 changes: 6 additions & 2 deletions modules/20-arithmetics/40-priority/en/EXERCISE.md
Original file line number Diff line number Diff line change
@@ -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
```
8 changes: 6 additions & 2 deletions modules/20-arithmetics/40-priority/es/EXERCISE.md
Original file line number Diff line number Diff line change
@@ -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:

Check notice on line 3 in modules/20-arithmetics/40-priority/es/EXERCISE.md

View workflow job for this annotation

GitHub Actions / LanguageTool

[LanguageTool] modules/20-arithmetics/40-priority/es/EXERCISE.md#L3

It appears that a hyphen is missing in the plural noun “to-dos”? (TO_DO_HYPHEN[4]) Suggestions: `to-dos` URL: https://languagetool.org/insights/post/hyphen/#compound-adjectives-with-hyphens Rule: https://community.languagetool.org/rule/show/TO_DO_HYPHEN?lang=en-US&subId=4 Category: GRAMMAR
Raw output
modules/20-arithmetics/40-priority/es/EXERCISE.md:3:148: It appears that a hyphen is missing in the plural noun “to-dos”? (TO_DO_HYPHEN[4])
 Suggestions: `to-dos`
 URL: https://languagetool.org/insights/post/hyphen/#compound-adjectives-with-hyphens 
 Rule: https://community.languagetool.org/rule/show/TO_DO_HYPHEN?lang=en-US&subId=4
 Category: GRAMMAR

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
```
7 changes: 6 additions & 1 deletion modules/20-arithmetics/45-linting/en/EXERCISE.md
Original file line number Diff line number Diff line change
@@ -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`.
7 changes: 6 additions & 1 deletion modules/20-arithmetics/45-linting/es/EXERCISE.md
Original file line number Diff line number Diff line change
@@ -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`.
11 changes: 3 additions & 8 deletions modules/25-strings/10-quotes/en/EXERCISE.md
Original file line number Diff line number Diff line change
@@ -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.
11 changes: 3 additions & 8 deletions modules/25-strings/10-quotes/es/EXERCISE.md
Original file line number Diff line number Diff line change
@@ -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.
8 changes: 4 additions & 4 deletions modules/25-strings/15-escape-characters/en/EXERCISE.md
Original file line number Diff line number Diff line change
@@ -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.
9 changes: 4 additions & 5 deletions modules/25-strings/15-escape-characters/es/EXERCISE.md
Original file line number Diff line number Diff line change
@@ -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.
4 changes: 2 additions & 2 deletions modules/25-strings/15-escape-characters/ru/EXERCISE.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Вы пишете программу, которая показывает пользователю подсказку о том, как разбить текст на строки. Выведите подсказку одним вызовом `print()`:

```text
Для разделения строк используйте "\n"
Пример: print("строка1\nстрока2")
Use "\n" to separate lines
Example: print("line1\nline2")
```

Обратите внимание: `\n` в первой строке — это буквальный текст, а не перевод строки.
2 changes: 1 addition & 1 deletion modules/25-strings/15-escape-characters/solution.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
print('Для разделения строк используйте "\\n"\nПример: print("строка1\\nстрока2")')
print('Use "\\n" to separate lines\nExample: print("line1\\nline2")')
2 changes: 1 addition & 1 deletion modules/25-strings/15-escape-characters/test_solution.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down
7 changes: 3 additions & 4 deletions modules/25-strings/20-string-concatenation/en/EXERCISE.md
Original file line number Diff line number Diff line change
@@ -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.
7 changes: 3 additions & 4 deletions modules/25-strings/20-string-concatenation/es/EXERCISE.md
Original file line number Diff line number Diff line change
@@ -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.
3 changes: 2 additions & 1 deletion modules/30-variables/10-definition/en/EXERCISE.md
Original file line number Diff line number Diff line change
@@ -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.
3 changes: 2 additions & 1 deletion modules/30-variables/10-definition/es/EXERCISE.md
Original file line number Diff line number Diff line change
@@ -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.
11 changes: 9 additions & 2 deletions modules/30-variables/12-change/en/EXERCISE.md
Original file line number Diff line number Diff line change
@@ -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
```
11 changes: 9 additions & 2 deletions modules/30-variables/12-change/es/EXERCISE.md
Original file line number Diff line number Diff line change
@@ -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
```
2 changes: 1 addition & 1 deletion modules/30-variables/12-change/ru/EXERCISE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Статус заказа обновляется по мере его продвижения. В начале заказ находится «в пути», затем переходит в статус «доставлен».

В упражнении определена переменная `delivery_status` со значением `"в пути"`. Переопределите ее значение на `"доставлен"` и выведите на экран.
В упражнении определена переменная `delivery_status` со значением `"in transit"`. Переопределите ее значение на `"delivered"` и выведите на экран.

Пример переопределения переменной:

Expand Down
4 changes: 2 additions & 2 deletions modules/30-variables/12-change/solution.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
delivery_status = "в пути"
delivery_status = "in transit"

# BEGIN
delivery_status = "доставлен"
delivery_status = "delivered"
# END

print(delivery_status)
2 changes: 1 addition & 1 deletion modules/30-variables/12-change/test_solution.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


def test(capsys):
expected = "доставлен"
expected = "delivered"
expect_output(capsys, expected)


Expand Down
Loading
Loading