Skip to content
Open
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
8 changes: 4 additions & 4 deletions modules/25-strings/20-string-concatenation/ru/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ print('Hello' + ', ' + 'World!')

```text
'Hello' + ', ' + 'World!'
└──┬──┘ └┬┘ └──┬───┘
└───┬───┘ │
'Hello, ' + 'World!'
└──────┬───────┘
└──┬──┘ └┬┘ └──┬───┘
└───┬───┘
'Hello, ' + 'World!'
└───────────┘
'Hello, World!'
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
Каждое значение выводится на отдельной строке.

```text
distance ──────┐
├──→ fuel ──────┐
fuel_consumption ──├──→ trip_cost ──────┐
├──→ per_person
fuel_price ────────────────────┘
passengers ─────────────────────────────────────────
distance ────────
├──→ fuel ──┐
fuel_consumption ┘
├──→ trip_cost ──┐
fuel_price ──────────────────
├──→ per_person
passengers ───────────────────────────────────┘
```
14 changes: 7 additions & 7 deletions modules/48-conditionals/30-if/ru/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ if 5 > 3:
Здесь строка `"Yes, it is true"` напечатается, потому что условие `5 > 3` истинно.

```text
┌──────────
│ условие?
└─────┬────
True │
┌──────────┐
│ условие? │
└─────┬────┘
│ True
┌──────────
│ тело if
└──────────
┌──────────┐
│ тело if │
└──────────┘
```

## Отступы в блоках
Expand Down
17 changes: 9 additions & 8 deletions modules/48-conditionals/40-if-else/ru/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@ print(get_type_of_sentence('Hodor?')) # => Sentence is question
Мы добавили `else` и новый блок. Он выполнится, если условие в `if` окажется ложным. Еще в блок `else` можно вкладывать другие условия `if`. Else переводится "иначе", "в ином случае".

```text
┌───────────┐
│ условие? │
└─────┬─────┘
True │ │ False
↓ ↓
┌──────────┐ ┌──────────┐
│ тело if │ │ тело else│
└──────────┘ └──────────┘
┌──────────┐
│ условие? │
└─────┬────┘
┌─────┴──────┐
True │ │ False
↓ ↓
┌─────────┐ ┌───────────┐
│ тело if │ │ тело else │
└─────────┘ └───────────┘
```

Пример вложенных блоков:
Expand Down
28 changes: 15 additions & 13 deletions modules/48-conditionals/50-else-if/ru/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,21 @@ print(get_type_of_sentence('No!')) # => 'Sentence is exclamation'
Теперь все условия выстроились в единую конструкцию. Ключевое слово `elif` означает "если не выполнено предыдущее условие, но выполнено текущее".

```text
┌─────────────────┐
│ условие 1? │
└────┬────────┬───┘
True │ │ False
↓ ↓
┌──────────┐ ┌─────────────────┐
│ тело if │ │ условие 2? │
└──────────┘ └────┬────────┬───┘
True │ │ False
↓ ↓
┌──────────┐ ┌──────────┐
│тело elif │ │ тело else│
└──────────┘ └──────────┘
┌────────────┐
│ условие 1? │
└──────┬─────┘
┌─────────┴─────────┐
True │ │ False
↓ ↓
┌─────────┐ ┌────────────┐
│ тело if │ │ условие 2? │
└─────────┘ └──────┬─────┘
┌──────┴──────┐
True │ │ False
↓ ↓
┌───────────┐ ┌───────────┐
│ тело elif │ │ тело else │
└───────────┘ └───────────┘
```

Логика функции устроена так. Если последняя буква `?`, возвращается `'question'`. Если последняя буква `!`, возвращается `'exclamation'`. Во всех остальных случаях возвращается `'normal'`.
Expand Down
Loading