← All lessons

Strings

Sign in · Sign up

Lesson 1.4

A string is text in quotes. Strings can be glued together with +:

"Hello, " + "Mia"   # Hello, Mia

The space between words is part of the string too. Without it you'd get Hello,Mia.

Create a variable with a name and print a greeting:

Hello, Mia!
Hint

Adding strings means putting one after another with +.

Store the name in a variable, then in print add three parts: "Hello, ", the variable and "!". Don't forget the space after the comma — and there is none before !.