Learn
01.1 | GETTING SET UP: EDITOR AND PYTHON
01 | THREE THINGS THAT WORK TOGETHER
Imagine writing a recipe. The words on the page describe the instructions, but somebody still needs to follow them. Python code works in a similar way: a file contains instructions, and the Python interpreter executes them.
Python is the programming language. The interpreter is the installed program that runs your Python code. An editor is where you write and change that code. IDLE includes an editor and an interactive shell; VS Code is an editor that gains Python features through an extension.
Installing VS Code alone does not install a Python interpreter. Installing its Python extension does not replace that interpreter either. Keeping these roles separate helps you solve setup problems without changing code that is already correct.
02 | CHOOSE IDLE OR VS CODE
Both choices run the same Python language. IDLE is a straightforward starting point: fewer panels and an obvious separation between the file editor and the shell. VS Code offers project folders, completion, debugging and support for other languages as your projects grow.
You do not need to set up both before writing your first program. Start with IDLE if you want the simplest route, or VS Code if it is already used in your class. Finish the complete save-and-run cycle in your chosen tool before exploring another.
On a managed school computer, Python may already be installed. Follow your school’s installation process. On a Chromebook, a desktop setup depends on whether an approved Linux environment is available; ask your teacher for the supported route rather than applying Windows instructions.
03 | INSTALL PYTHON FROM THE OFFICIAL SOURCE
Go to the official Python downloads page and choose a stable Python 3 release supported by your operating system. Avoid a preview release when beginning. Follow the current platform instructions; installer screens and Windows installation options can change.
On Windows, use the official installation route and make sure the Python runtime and IDLE are available. If a traditional installer offers an Add Python to PATH option, enabling it helps terminal commands locate Python. Newer install-manager workflows may use different options. On macOS, a current python.org installer normally provides the components IDLE needs.
Linux distributions often provide Python already but package IDLE separately. Use your distribution or school’s approved package instructions. The goal is a usable Python 3 installation, not a particular version number copied from an old screenshot.
04 | CHECK WHAT IS INSTALLED
Open a terminal: PowerShell or Command Prompt on Windows, Terminal on macOS, or your Linux terminal. Try the command appropriate to your installation. Windows commonly supports py --version; macOS and Linux commonly use python3 --version.
A response beginning Python 3 confirms that command finds an interpreter. A “not found” message usually means installation or command discovery needs attention. It does not mean the lesson’s print instruction is wrong.
Some systems also support python --version, but check what version it actually reports. If you install Python while a terminal is open, close and reopen the terminal before checking again.
py --version # Windows: run in a terminal, not inside a .py file python3 --version # macOS/Linux: run in a terminal, not inside a .py file
05 | MAKE A HOME FOR YOUR PROGRAMS
Create a folder called python-first-steps in a location you can find again. Store this section’s files there. Meaningful filenames such as hello.py and calculator.py make it clear which file you intend to run.
The .py extension identifies a Python source file. Check that your file has not become hello.py.txt. In a file manager that hides extensions, enable their display if necessary.
A source file is plain text containing code. Saving it preserves your instructions; running it executes them. These are two different actions. Keep a copy using your school’s approved storage or backup method so your work is available for the next lesson.
06 | IDLE: SHELL AND EDITOR ARE DIFFERENT
Open IDLE. Its shell usually shows a Python version banner and a >>> prompt. A prompt is the shell’s invitation to type an instruction. You can try print("Hello, Python!") there and press Enter for an immediate result.
For a saved program, choose File > New File to open an editor window. Type the program below without adding >>>. Save it as hello.py in your project folder.
In the editor, choose Run > Run Module, commonly F5. The output appears in the shell, while the source remains in the editor. If a keyboard function key is intercepted by your computer, use the Run menu.
print("Hello, Python!")EXPECTED OUTPUT
Hello, Python!
07 | VS CODE: ADD THE PYTHON EXTENSION
Download Visual Studio Code from its official site, then install it using your computer’s approved process. Open the Extensions view and find Python published by Microsoft. Install and enable it.
Open your python-first-steps folder using File > Open Folder. Create hello.py in the Explorer and type the same print instruction. Opening a folder gives the editor a clear project location rather than a collection of unrelated files.
The extension adds Python-aware editing and run commands. A separate third-party Code Runner extension is not required for this course. In particular, use the Python terminal run command so later input() programs can receive typed responses.
08 | VS CODE: SELECT THE INTERPRETER AND RUN
Open the Command Palette, usually Ctrl+Shift+P on Windows/Linux or Command+Shift+P on macOS. Choose Python: Select Interpreter and select the Python 3 installation you intend to use.
Save hello.py. Use Run Python File in Terminal, available through the Python run button or the editor’s context menu. A terminal panel opens and shows the result. Menu wording can vary with editor updates, but choose the Python file-in-terminal action.
The terminal may show a command and a system prompt around your output. Those are not lines printed by your program. For this first section, one interpreter is enough; virtual environments become useful when you start installing project-specific packages later.
09 | PROVE YOU ARE RUNNING THE FILE YOU CHANGED
Change the message to include your name. Save, then run the whole file again. If the output changes, you have checked the complete cycle: edit, save, execute, inspect.
If the old message remains, check the active filename and folder. You might have two files called hello.py in different places, or you might have run a selected old line instead of the whole file.
Close the editor, reopen your saved file and run it again. A file that still works after reopening is a better setup check than a command that exists only in shell history.
print("Hello from Maya!")
print("My Python setup works.")EXPECTED OUTPUT
Hello from Maya! My Python setup works.
10 | SOLVE ONE LAYER AT A TIME
No Python command found? Check installation and the command name. No Python run action in VS Code? Check the file extension and Microsoft Python extension. Wrong runtime? Select the interpreter. No IDLE application? Check whether your Python installation includes the optional IDLE/Tk components.
A SyntaxError after Python starts is a code issue: check the message, parentheses and quotation marks. An editor’s coloured text alone does not prove the program runs.
Keep these categories separate. Reinstalling everything is rarely the best first response to one missing quote. Write down the exact message and the step that produced it so you can ask a clear question.
11 | SETUP CHECKLIST YOU CAN TEST
Use the checklist below to record your progress. The page checks your selected evidence, not your computer’s installation. Only tick an item after performing it.
12 | YOUR FIRST INDEPENDENT CHALLENGE
Create a second file called about_me.py. Make it print three lines: your first name, one hobby and one thing you want to build with Python. Use invented details if you prefer.
Save it, run it, change the hobby and run it again. Show a partner the source file and its output, explaining which tool edits the code and which tool executes it.
Official references: IDLE documentation and VS Code Python tutorial.