Install Python
Put the Python interpreter on your own computer and run your first local program.
Learn it
Install Python from python.org, then check it with a version command.
Now install Python itself. Always get it from the official site, python.org, or the official store for your system. Never download Python from random websites.
Choose the latest Python 3 version offered (3.12 or newer is great). Version numbers look like 3.13.1: everything in this course works on any recent Python 3.
After installing, you will check it with a version command, then write a tiny program in a file and run it. One difference to remember: on macOS and Linux the command is usually python3. On Windows it is python or py.
py install --configure and accept the changes, or reinstall with the classic installer and tick Add python.exe to PATH.- Install the Python install manager, the official tool from python.org. Easiest way: open the Microsoft Store, search for Python install manager and click Get. Or type this in Terminal:
winget install 9NQ7512CXL7T
Alternative: download the classic installer from python.org/downloads. If you use it, tick Add python.exe to PATH on the first screen. - Close Terminal and open a new one, so it notices the new install. Then install the latest Python:
py install default
If it asks configuration questions, such as adding a folder to PATH, answer y (yes). - Check it worked:
python --version
You should see something likePython 3.14.0
- Go to your project folder and create a file. Type the command below, then type
print("Hello from my own computer!")into Notepad, save and close it.cd ~\code\vault_breaker
notepad hello.py
- Run your program:
python hello.py
You should see something likeHello from my own computer!
- Go to python.org/downloads in your browser and click the big Download Python 3.x button. It detects macOS automatically.
- Open the downloaded .pkg file and click through the installer (Continue, Agree, Install). Enter your Mac password when asked.Already use Homebrew?
brew install pythonworks too. - Open a new Terminal window and check it worked. On a Mac, use
python3:python3 --version
You should see something likePython 3.14.0
- Create a file in your project folder. The
nanoeditor opens in the terminal: typeprint("Hello from my own computer!"), press Ctrl + O then Enter to save, and Ctrl + X to exit.cd ~/code/vault_breaker
nano hello.py
- Run your program:
python3 hello.py
You should see something likeHello from my own computer!
- Most Linux systems already have Python 3. Check first:
python3 --version
- Install or update Python with the tools for packages and virtual environments (Ubuntu, Debian and ChromeOS Linux). Type your password if asked:
sudo apt update
sudo apt install -y python3 python3-pip python3-venv
- Check again:
python3 --version
You should see something likePython 3.12.3
- Create a file. In
nano, typeprint("Hello from my own computer!"), press Ctrl + O, Enter, then Ctrl + X.cd ~/code/vault_breaker
nano hello.py
- Run your program:
python3 hello.py
You should see something likeHello from my own computer!
Capture the flag
+10 XPOn macOS and Linux, which command usually runs Python 3?
Create a free account to start this lab
Sign in to answer the flag question. Your progress, XP and code are saved to your account. No card needed.
Hello, local world
+20 XPProve Python works on your computer.
Create a free account to start this lab
Sign in to do this homework and have it checked. Your progress, XP and code are saved to your account. No card needed.