-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #319 from hexlet-basics/new
new structure
- Loading branch information
Showing
642 changed files
with
12,528 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Copy the exact code from the instructions into the editor and run it by clicking “Run”. | ||
|
||
```python | ||
print('Hello, World!') | ||
``` | ||
|
||
Note: if you write `heLLo, woRld!` instead of `Hello, World!`, it will be considered different text, because upper and lower case letters are different characters and different _registers_. In programming, the register almost always matters, so get used to always paying attention to it! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Learning a new programming language traditionally begins with 'Hello, world!'. It is a simple program that both displays a greeting on the screen, and introduces the new language, showing its syntax and its program structure. | ||
|
||
<pre class='hexlet-basics-output'> | ||
Hello, World! | ||
</pre> | ||
|
||
This tradition is over forty years old, so we're not thinking of breaking it any time soon. In the first lesson, we'll write a program called `Hello, world!`. To do this, you have to give the computer a special command. In Python, it's: `print()`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
name: Hello, world! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Escribe en el editor el código del ejercicio, carácter por carácter, y luego haz clic en "Verificar". | ||
|
||
```python | ||
print('Hello, World!') | ||
``` | ||
|
||
Atención: si escribes `heLLo, woRld!` en lugar de `Hello, World!`, el sistema lo considerará un texto diferente, ya que el tamaño de la letra implica el uso de caracteres diferentes que difieren en _mayúsculas y minúsculas_. En programación, la capitalización casi siempre importa, así que acostúmbrate a prestarle siempre atención a esos pequeños detalles. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Por lo general, el aprendizaje de un nuevo lenguaje de programación comienza con 'Hello, World!'. Este es un programa simple que muestra un saludo en la pantalla, y al mismo tiempo, familiariza al usuario con el nuevo lenguaje, así como con su sintaxis y la estructura del programa. | ||
|
||
<pre class='hexlet-basics-output'> | ||
Hello, World! | ||
</pre> | ||
|
||
Esta tradición tiene más de cuarenta años, por lo cual no la romperemos. En la primera lección escribiremos el programa `Hello, World!`. Para hacerlo, debemos darle al ordenador un comando especial. En Python, este comando se llama `print()`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
name: ¡Hola, Mundo! | ||
tips: | ||
- > | ||
[Un poco sobre 'Hello, | ||
World!'](https://codica.la/blog/mi-gente-me-entiende-la-historia-de-la-frase-hello-world-y-sus-analogos) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Наберите в редакторе код из задания символ в символ и нажмите «Проверить». | ||
|
||
```python | ||
print('Hello, World!') | ||
``` | ||
|
||
Внимание: если вы напишете `heLLo, woRld!` вместо `Hello, World!`, то это будет считаться другим текстом, потому что заглавные и строчные буквы — это разные символы, отличающиеся _регистром_. В программировании регистр практически всегда имеет значение, поэтому привыкайте всегда обращать на него внимание! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Изучение нового языка программирования традиционно начинается с 'Hello, World!'. Это простая программа, которая выводит приветствие на экран и заодно знакомит с новым языком — его синтаксисом и структурой программы. | ||
|
||
<pre class='hexlet-basics-output'> | ||
Hello, World! | ||
</pre> | ||
|
||
Этой традиции уже больше сорока лет, поэтому и мы не будем нарушать ее. В первом уроке мы напишем программу `Hello, World!`. Чтобы сделать это, нужно дать компьютеру специальную команду. В языке Python это — `print()`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
name: Привет, Мир! | ||
tips: | ||
- > | ||
[Немного о 'Hello, | ||
World!'](https://ru.hexlet.io/blog/posts/moy-chelovek-menya-ponimaet-istoriya-frazy-hello-world-i-ee-analogov) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
Create a one-line comment with the text: `You know nothing, Jon Snow!` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
Almost all programming languages allow you to leave comments in your code. The interpreter ignores them. They're only for people; they let the programmer leave notes for themselves and other programmers. | ||
|
||
They allow you to add explanations of how the code works, what errors need to be corrected, or what you need to remember to add later: | ||
|
||
```python | ||
# Delete the line below after the registration task is done | ||
print(10) | ||
``` | ||
|
||
Comments in Python begin with the `#` sign and can appear anywhere in the program. They can take up an entire line. If one line is not enough, you can create several comments: | ||
|
||
```python | ||
# For Winterfell! | ||
# For Lanisters! | ||
``` | ||
|
||
The comment can be on the line after the code: | ||
|
||
```python | ||
print('I am the King') # For Lannisters! | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
name: Comments | ||
tips: [] | ||
definitions: | ||
- name: Comments | ||
description: > | ||
text in the program code that does not affect the functionality and is | ||
added by programmers for themselves and their colleagues. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
Crea un comentario de una línea con el texto: `You know nothing, Jon Snow!` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
Casi todos los lenguajes de programación permiten dejar comentarios en el código. Estos comentarios no son utilizados por el sistema intérprete. Son útiles únicamente para las personas que usan estas herramientas; para que los programadores puedan dejar notas para ellos mismos y también para otros programadores. | ||
|
||
A través de estos comentarios, se agregan explicaciones sobre cómo funciona el código, qué errores corregir o qué agregar más adelante. | ||
|
||
```python | ||
# Eliminar la línea de abajo después de implementar la tarea de registro | ||
print(10) | ||
``` | ||
|
||
Los comentarios en Python comienzan con el signo `#` y pueden aparecer en cualquier lugar del programa. Pueden ocupar toda una línea. Si una línea no es suficiente, se pueden crear varios comentarios: | ||
|
||
```python | ||
# ¡For Winterfell! | ||
# ¡For Lannisters! | ||
``` | ||
|
||
Un comentario puede estar en la línea después del código: | ||
|
||
```python | ||
print('I am the King') # ¡For Lannisters! | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
name: Comentarios | ||
tips: | ||
- > | ||
[Más información sobre | ||
comentarios](https://www.w3schools.com/python/python_comments.asp) | ||
definitions: | ||
- name: Comentario | ||
description: > | ||
se trata de un texto en el código de un programa que no afecta su | ||
funcionalidad y lo agregan los programadores para su propio uso y/o el de | ||
sus colegas. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
Создайте однострочный комментарий с текстом: `You know nothing, Jon Snow!` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
Практически все языки программирования позволяют оставлять в коде комментарии. Они никак не используются интерпретатором. Они нужны исключительно для людей, чтобы программист оставлял пометки для себя и для других программистов. | ||
|
||
С их помощью добавляют пояснения, как работает код, какие ошибки нужно поправить или не забыть что-то добавить позже: | ||
|
||
```python | ||
# Удалить строку ниже после реализации задачи по регистрации | ||
print(10) | ||
``` | ||
|
||
Комментарии в Python начинаются со знака `#` и могут появляться в любом месте программы. Они могут занимать всю строку. Если одной строки мало, то создается несколько комментариев: | ||
|
||
```python | ||
# For Winterfell! | ||
# For Lanisters! | ||
``` | ||
|
||
Комментарий может находиться на строке после кода: | ||
|
||
```python | ||
print('I am the King') # For Lannisters! | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
name: Комментарии | ||
tips: | ||
- > | ||
[Подробнее о | ||
комментариях](https://www.w3schools.com/python/python_comments.asp) | ||
definitions: | ||
- name: Комментарий | ||
description: > | ||
текст в коде программы, который не влияет на функциональность и | ||
добавляется программистами для себя и своих коллег. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Display three names, one after another: _Robert_, _Stannis_, _Renly_. The result should be that the following is shown on the screen: | ||
|
||
<pre class='hexlet-basics-output'> | ||
Robert | ||
Stannis | ||
Renly | ||
</pre> | ||
|
||
For each name, use Python's own `print()` call. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
When we're making a dish, we follow the recipe carefully. Otherwise, the food won't turn out as expected. The same rule applies to programming. | ||
|
||
If you want to see the expected result onscreen, the computer needs to have clear, step-by-step directions. This can be done using instructions. An instruction is a command to the computer, a unit of execution. Python code in this case is a set of instructions. It can be presented as a step-by-step recipe. | ||
|
||
Python code is run by an **interpreter**, a program that executes instructions strictly, line by line. Like the steps in a recipe, the instructions for the interpreter are written in order and are separated from each other by skipping to the next line. | ||
|
||
Developers must understand the order of operations in the code, and be able to mentally divide the program into independent parts that are convenient for analysis. | ||
|
||
Let's look at an example of some code with two instructions. When it's started, two sentences are displayed sequentially on the screen: | ||
|
||
```python | ||
print('Mother of Dragons.') | ||
print('Dracarys!') | ||
# => Mother of Dragons. | ||
# => Dracarys! | ||
``` | ||
|
||
We said above that instructions are separated from each other by a line break. But there is another way; they can be separated by a semicolon — `;`: | ||
|
||
```python | ||
print('Mother of Dragons.'); print('Drakarys!') | ||
``` | ||
|
||
There is no technical difference between the first and second version; the interpreter will understand the instructions the same way. The only difference is that it's inconvenient, physically, to read the second version. | ||
|
||
It's better to place the instructions under each other. This makes it easier for colleagues to read your code, maintain it, and make changes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: Statements | ||
tips: | ||
- > | ||
[A little bit about | ||
interpreters](https://en.wikipedia.org/wiki/Interpreter_(computing)) | ||
definitions: | ||
- name: Interpreter | ||
description: | | ||
a program that runs code in Python. | ||
- name: Statement | ||
description: >- | ||
a command for the computer written in a programming language. Python code | ||
is a set of instructions, most often separated by a line break. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Imprime en la pantalla uno tras otro tres nombres: *Robert*, *Stannis*, *Renly*. Como resultado, se debe mostrar en la pantalla: | ||
|
||
<pre class='hexlet-basics-output'> | ||
Robert | ||
Stannis | ||
Renly | ||
</pre> | ||
|
||
Por cada nombre o designación, usa nuevamente la orden de `print()`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
Cuando preparamos una comida, seguimos la receta al pie de la letra. De lo contrario, la comida no saldrá como esperábamos. Esta regla también se aplica a la programación. | ||
|
||
Para ver el resultado esperado en la pantalla, es necesario darle al ordenador instrucciones claras, paso a paso. Una instrucción es un comando para el ordenador; una unidad de ejecución. En este caso, el código en Python es un conjunto de instrucciones. Se puede representar como una receta de cocina paso a paso. | ||
|
||
El código en Python es ejecutado por un **intérprete** - es decir, un programa que ejecuta las instrucciones recibidas en orden. Al igual que los pasos en una receta, el conjunto de instrucciones para el intérprete se escriben en orden y se separan por saltos de línea. | ||
|
||
Los desarrolladores deben entender el orden de las acciones en el código y ser capaces de dividir mentalmente el programa en partes independientes, fáciles de analizar. | ||
|
||
Veamos un ejemplo de código con dos instrucciones. Al ejecutarlo, se mostrarán en la pantalla dos frases en secuencia: | ||
|
||
```python | ||
print('Mother of Dragons.') | ||
print('Dracarys!') | ||
# => Mother of Dragons. | ||
# => Dracarys! | ||
``` | ||
|
||
https://replit.com/@hexlet/python-basics-instructions | ||
|
||
Anteriormente hemos señalado que las instrucciones se separan por saltos de línea. Pero también hay otra forma: se pueden separar por punto y coma (`;`): | ||
|
||
```python | ||
print('Mother of Dragons.'); print('Drakarys!') | ||
``` | ||
|
||
No hay diferencia técnica alguna entre la primera y la segunda opción: el intérprete entenderá las instrucciones de la misma manera. La única diferencia es que la segunda opción puede ser incómoda de leer para los humanos. | ||
|
||
Es mejor colocar las instrucciones una debajo de la otra. De esta manera, será más fácil para tus colegas leer tu código, mantenerlo y realizar cambios en él. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: Instrucciones | ||
tips: | ||
- > | ||
[Más información sobre los | ||
intérpretes](https://es.wikipedia.org/wiki/Int%C3%A9rprete) | ||
definitions: | ||
- name: Intérprete | ||
description: | | ||
un programa que ejecuta código en Python. | ||
- name: Instrucción | ||
description: >- | ||
un comando para el ordenador escrito en un lenguaje de programación. El | ||
código en Python es un conjunto de instrucciones separadas (generalmente) | ||
por saltos de línea. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Выведите на экран друг за другом три имени: *Robert*, *Stannis*, *Renly*. В результате на экране должно отобразиться: | ||
|
||
<pre class='hexlet-basics-output'> | ||
Robert | ||
Stannis | ||
Renly | ||
</pre> | ||
|
||
Для каждого имени используйте свой собственный вызов `print()`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
Когда мы готовим блюдо, то четко следуем рецепту. Иначе еда окажется не такой, как ожидали. Это же правило действует и в программировании. | ||
|
||
Чтобы увидеть на экране ожидаемый результат, нужно дать компьютеру четкие и пошаговые указания. Это можно сделать с помощью инструкций. Инструкция — это команда для компьютера, единица выполнения. Код на Python в этом случае — это набор инструкций. Его можно представить в виде пошагового рецепта. | ||
|
||
Код на Python запускает **интерпретатор** — программу, которая выполняет инструкции строго по очереди. Как и шаги в рецепте, набор инструкций для интерпретатора пишутся по порядку и отделяются друг от друга переходом на следующую строку. | ||
|
||
Разработчики должны понимать порядок действий в коде и уметь мысленно разделять программу на независимые части, удобные для анализа. | ||
|
||
Посмотрим на пример кода с двумя инструкциями. При его запуске на экран последовательно выводятся два предложения: | ||
|
||
```python | ||
print('Mother of Dragons.') | ||
print('Dracarys!') | ||
# => Mother of Dragons. | ||
# => Dracarys! | ||
``` | ||
|
||
https://replit.com/@hexlet/python-basics-instructions | ||
|
||
Выше мы говорили, что инструкции отделяются друг от друга переходом на новую строку. Но есть и другой способ: их можно разделить точкой с запятой — `;`: | ||
|
||
```python | ||
print('Mother of Dragons.'); print('Drakarys!') | ||
``` | ||
|
||
Технической разницы между первым и вторым вариантом нет — интерпретатор поймет инструкции одинаково. Разница только в том, что человеку будет неудобно читать второй вариант. | ||
|
||
Лучше инструкции располагать друг под другом. Так коллегам будет удобнее читать ваш код, обслуживать его и вносить изменения. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: Инструкции (Statements) | ||
tips: | ||
- | | ||
[Немного об интерпретаторах](https://ru.wikipedia.org/wiki/Интерпретатор) | ||
definitions: | ||
- name: Интерпретатор | ||
description: | | ||
программа, выполняющая код на Python. | ||
- name: Инструкция (statement) | ||
description: >- | ||
команда для компьютера, написанная на языке программирования. Код на | ||
Python — это набор инструкций, разделенных (чаще всего) переводом строки. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Display `9780262531962`. |
Oops, something went wrong.