Concept
Escape Codes (\n, \t)
A backslash `\` gives letters secret superpowers: - `\n`: Drops text down to a new line - `\t`: Inserts a tab space - `\\`: Prints an actual literal backslash
python
print("Hello\nWorld")
# 28. Escape Codes (\n, \t) A backslash `\` gives letters secret superpowers: - `\n`: Drops text down to a new line - `\t`: Inserts a tab space - `\\`: Prints an actual literal backslash ```python print("Hello\nWorld") ``` Spits out: ```text Hello World ```
Checkpoint
What does `\n` do inside a string?
Practice
Print `"Row 1"` and `"Row 2"` on two separate lines using a single `print()` call and `\n`.
01
Tap code blocks below to assemble
Available Blocks