Skip to content

Commit 331cb2f

Browse files
committed
fix examples with multiline
1 parent 193ecc2 commit 331cb2f

File tree

4 files changed

+17
-16
lines changed

4 files changed

+17
-16
lines changed
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
21
Write a program that displays on this the screen:
32

4-
- Did Joffrey agree?
5-
- He did. He also said "I love using \n".
3+
```text
4+
- Did Joffrey agree?
5+
- He did. He also said "I love using \n".
6+
```
67

78
This program should have only one `print()`, but the result on the screen should look exactly like the one shown above.

modules/25-strings/15-escape-characters/en/README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Here's some dialog we want to show:
33

4-
```
4+
```text
55
- Are you hungry?
66
- Aaaarrrgh!
77
```
@@ -25,7 +25,7 @@ print("- Are you hungry?\n- Aaaarrrgh!")
2525

2626
When you type text in Word, you press Enter at the end of a line. The editor puts a special invisible character at the end of the line called LINE FEED (LF). In some editors, you can actually display the invisible characters. Then the text will look something like this:
2727

28-
```
28+
```text
2929
- Hey!¶
3030
- Oh, hey!¶
3131
- How's it going?
@@ -46,7 +46,7 @@ print("Gregor Clegane\nDunsen\nPolliver\nChiswyck")
4646

4747
This will appear on the screen:
4848

49-
```
49+
```text
5050
Gregor Clegane
5151
Dunsen
5252
Polliver
@@ -58,7 +58,6 @@ When working with the line feed symbol, consider the following points:
5858
1. It doesn't matter what comes before or after `\n`: a character or an empty string. The line feed will be detected and executed in any case
5959

6060
2. A string can contain only `\n` and nothing else:
61-
6261
```python
6362
print('Gregor Clegane') # String with text
6463
print("\n") # String with an invisible line feed character
@@ -67,8 +66,8 @@ When working with the line feed symbol, consider the following points:
6766

6867
The program will display this on the screen:
6968

70-
```
71-
Gregor Clegane
69+
```text
70+
Gregor Ctextlegane
7271
7372
7473
Dunsen
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11

22
Напишите программу, которая выводит на экран:
33

4-
- Did Joffrey agree?
5-
- He did. He also said "I love using \n".
4+
```text
5+
- Did Joffrey agree?
6+
- He did. He also said "I love using \n".
7+
```
68

79
При этом программа использует только один `print()`, но результат на экране должен выглядеть в точности, как показано выше.

modules/25-strings/15-escape-characters/ru/README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,9 @@ Second line
8484

8585
- '\n' — один символ, несмотря на то, что в коде он записан как два (\ и n).
8686
- Если вы хотите вывести символы \n буквально (как текст), используйте двойной обратный слэш `\\n`:
87-
88-
```python
89-
print("Joffrey loves using \\n")
90-
# => Joffrey loves using \n
91-
```
87+
```python
88+
print("Joffrey loves using \\n")
89+
# => Joffrey loves using \n
90+
```
9291

9392
- На Windows по умолчанию используется комбинация \r\n, но в Python (и вообще в кроссплатформенной разработке) принято использовать только \n, чтобы избежать проблем при переносе кода между системами.

0 commit comments

Comments
 (0)