Back
+10 XP
Concept

Gluing Strings Together (+)

The `+` operator glues two strings together:

python
first = "Super"
last = "Mario"
print(first + " " + last)  # Prints: Super Mario

# 26. Gluing Strings Together (+) The `+` operator glues two strings together: ```python first = "Super" last = "Mario" print(first + " " + last) # Prints: Super Mario ``` Trap: Python will not add spaces for you. `"Super" + "Mario"` becomes `"SuperMario"`. And if you try `"Score: " + 100`, Python crashes with a `TypeError` because you can only glue text to text.

Checkpoint

What does `"Score: " + 100` do in Python?

Practice

Glue `"Game"` and `"Over"` together with a space in between, and print the result.

Terminal
01
Tap code blocks below to assemble
Available Blocks