Loading ARcademy...
0 of 57 lessons completed
In Python, a string is just a piece of text. Imagine a string as a digital necklace, where every letter, space, number, or punctuation mark is a bead strung together.
To tell Python that something is text (and not a command or variable), you must wrap it in single quotes (') or double quotes ("). Python treats both exactly the same!
player_name = "PixelNinja"
current_status = 'Online'
💡 Why have two types of quotes? What if your text contains an apostrophe, like the word "Don't"? If you use single quotes, Python gets confused and thinks the string ended early! To fix this, wrap the entire text in double quotes:
warning = "Don't open that door!"
Did you know you can add strings together? In programming, gluing two pieces of text together is called concatenation.
hero = "Spider" + "-" + "Man"
print(hero) # Output: Spider-Man