First contact.
Meet Python, set up your workspace, and make a machine say something back.
01 The idea
Python turns instructions written in a text file into actions. You write the instructions; the Python interpreter reads and executes them. Start small: one file, one message, one successful run. You do not need a complicated toolchain to begin.
After installing Python 3, run these commands in your terminal. On Windows, use py in place of python3.
python3 --version
python3 hello.py02 The experiment
Read it once. Predict what will happen. Then copy it into a .py file and run it in your local Python setup.
print("Hello, builder.")
print("Small script. Big possibilities.")Hello, builder. Small script. Big possibilities.
03 Under the hood
- 1
Install a supported Python 3 release from python.org and a code editor such as VS Code. Check the installation in your terminal: python3 --version on macOS/Linux or py --version on Windows. Some installations use python instead.
- 2
Create a file named hello.py and paste the example into it. In the terminal, open the folder containing the file. Run python3 hello.py on macOS/Linux or py hello.py on Windows.
- 3
print() is a built-in function. Text inside matching quotes is a string. Each print call writes a new line, so the two messages appear one below the other.
04 Your turn, builder
Print your name on the first line and one thing you would like to build on the second.
Reveal one possible solution +
print("Navan")
print("I want to build a tiny game.")05 Check your signal
What runs the instructions in a .py file?
Experiment. Logged.
When you can explain the idea and make the example your own, mark it complete. Your log stays in this browser.
Keep exploring
Go deeper with the official Python guide ↗.