Start with an existing example
Use Edit in Playground on the first program below. This opens the Playground with the example’s Python language and code. Python editing and file download remain available, but the Run control for a Python file is temporarily disabled while the execution environment is being isolated.
Change the string and add another print call, then save the file. Follow the installation guide for your operating system and run the saved file with python hello.py in a local terminal. The output should contain both messages.
Run the program locally
A local Python interpreter runs the downloaded .py file. The documentation’s Run example preview uses a separate sandboxed browser runtime; it does not enable Python execution in the Playground. Do not assume its version matches the interpreter installed on your computer.
To identify the local interpreter, run the following commands in a terminal. Check the version before using syntax introduced in newer releases.
Terminal — check your Python version
python --version
python hello.pyKnow what the editor provides
The Playground does not currently run Python files. It also has no configured interactive stdin workflow for Python. Run input-based exercises and terminal commands such as pip install on your own computer after installing Python.
Keep a saved copy of your source using the Playground’s existing file/download controls; do not assume unsaved edits are permanently stored. Never paste credentials or private work data into a practice example.
Keep learning
Once you can change a value and explain the local output, continue with the fundamentals below. Codectionary remains a reference while you run Python locally.
Syntax
print("Hello, Python!")Examples
Your first Python program
Save as hello.py in your project folder. Expected output: Hello, Python!
print("Hello, Python!")- print is a built-in function that writes to the output stream.
- The quoted text is a string. The quotes are not printed.
- Parentheses pass that string to print. No extra package is required.
Best practices
- Save your work before running it, and check the output after each small change.
- Keep your learning project in its own folder. Do not name files after standard modules such as random.py or json.py.
Runtime & versions
Python interpreter. Feature availability depends on the language and runtime version used by your project; consult the official reference below.
Python language reference