Concept
Single, Double & Triple Quotes
Single `'...'` and double `"..."` quotes are completely identical in Python. Pick one and stick with it. Need text that spans multiple lines without breaking? Use triple quotes `"""..."""`:
python
story = """Line one
Line two
Line three"""
print(story)
# 25. Single, Double & Triple Quotes Single `'...'` and double `"..."` quotes are completely identical in Python. Pick one and stick with it. Need text that spans multiple lines without breaking? Use triple quotes `"""..."""`: ```python story = """Line one Line two Line three""" print(story) ``` Triple quotes preserve every single line break and space exactly as typed.
Checkpoint
When do you actually need triple quotes `"""`?
Practice
Create a 2-line message using triple quotes `"""` and print it.
01
Tap code blocks below to assemble
Available Blocks