📚
ASCII Art
Printing on Multiple Lines
So far, each
print()print()If you want to display something across several lines (like a picture made of text), you have two options:
Option 1: Multiple print() calls
Each
print()print(" * ") print(" *** ") print("*****") # → * # → *** # → *****
Option 2: The \n character
Inside a string,
\nprint("Line 1\nLine 2\nLine 3") # → Line 1 # → Line 2 # → Line 3
It looks like two characters (
\nAbout Backslashes
The
\\\\print("\\") # → prints one backslash: \
💡💡 Tip: For this exercise, using multiple
calls (one per line) is the simplest approach!print()
main.pySandbox
main.py
Ctrl + Enter