You install Python, discover the REPL, and print your first message with print.
Open this lesson in KodokonWelcome! A program is a list of instructions that the computer runs one after another. To write these instructions, we use a programming language: a set of words and rules that the computer understands. Python is one of these languages, known for its readability: it's the ideal choice to get started. First step: head to the official website python.org, section "Downloads", and install the latest version. On Windows, tick the Add Python to PATH box: it makes Python accessible from the terminal, a window in which you type commands with the keyboard (search for "Terminal" or "PowerShell" in your menu).
python --versionPython offers an interactive mode called the REPL (Read-Eval-Print Loop). It reads what you type, runs it immediately, and displays the result. To open it, type python in the terminal. The three chevrons >>> then prompt you to write code. Try a simple calculation, then quit with exit().
2 + 3
7 * 6The REPL is perfect for testing, but a real program is written in a file. Open a text editor (VS Code, for example, which is free) and discover print. It's a function: a ready-made instruction that you call by its name, followed by parentheses. print displays on screen whatever you give it inside the parentheses. The text must be placed inside quotation marks: this is called a string.
print("Hello, world!")
print("I'm programming in Python.")print function do?hello.py file from the terminal?