LessonΒ·difficulty 1/5Β·~6 min
Say your name
Text in Python is called a string. You can glue strings together with +
to build a bigger sentence:
python
food = "samosa"
sentence = "I love " + food
print(sentence) # I love samosa
Your task
- Set
nameto your name (any non-empty text in quotes). - Build a variable
introthat joins the text"Hi, my name is "withname, using+.
The samosa example above shows the exact move β now write your own two lines
the same way (your name, then glue it on with +), and print(intro).
Mind the space after
isinside the quotes β without it you'd getHi, my name isSam. Strings join exactly as written.
Tests
- you picked a name
- intro starts with the greeting
β¦ Stuck? Ask for a spark
Sign in or create a free account to use your monthly AI explainer allowance.
warming up
Loading editorβ¦
Consolewaiting
$ Console output will appear here.