Ask for a name
This page needs a recent browser (with SharedArrayBuffer support). Please update Chrome, Edge, Firefox or Safari to the latest version.
This one builds on a lesson you haven't finished yet. Do that lesson first:
Python Basics · Getting input →
Ask for a name
input() reads one line that the user types. Store it in a box, then use it.
When you press Run, the program waits: a highlighted box appears under the code. Type a name there and press Enter. Check answer types Sam for you.
Difficulty 1/5 · 100 coins + a small bonus on first completion today
Read a name with input(). Then show Hi, + the name + !. For Sam, show Hi, Sam!.
Click Run to see the output here.