Codectionary / Developer documentation / Python

Introduction to Python

Start here: understand what Python does, choose a place to practise, and write your first program. You do not need previous programming experience.

File extension
.py
Runs in
Python interpreter
Official Python two-snakes logo

Python and its logo are trademarks of the Python Software Foundation. Codectionary is independent and is not endorsed by the PSF.

Official Python artwork · Official SVG · Official PNG

Your first steps

You only need basic computer skills: opening a browser, creating a folder and saving a text file. You do not need advanced mathematics to learn the language. The aim is to turn a small problem into instructions you can run, inspect and improve.

Read this overview, then choose ONE way to practise. Install Python for running programs locally; the Playground can still edit Python files, but its Python Run control is temporarily paused while an isolated runner is being completed. Follow the guide for your operating system, then choose one editor. You do not need to install all five editors.

After you can run the first program, continue to variables, output, types, conditions, loops, collections and functions. Learn package installation when a project actually needs an external library.

What Python is

Python is a high-level, general-purpose programming language. High-level means you can work with ideas such as lists, text and dictionaries without manually managing every memory address. General-purpose means the same language can solve many kinds of problem.

Python supports procedural programming with statements and functions, object-oriented programming with classes, and functional techniques such as passing functions as values. You can begin with a few statements and introduce these other approaches as the problem grows.

Types belong to objects, and names refer to objects. You can bind a name to a number and later to text, but operations still have rules: Python does not automatically make every incompatible value fit. Indentation groups statements into blocks; it is part of the syntax, not just presentation.

Where Python came from

Guido van Rossum began implementing Python in December 1989 at CWI in the Netherlands. He wanted an extensible scripting language for work on the Amoeba operating system: more convenient for these tasks than writing C programs or shell scripts, while retaining ideas he valued from ABC.

The first public version, Python 0.9.0, was posted to alt.sources on 20 February 1991. Python 1.0 followed in 1994, Python 2.0 in 2000, and Python 3.0 in December 2008. Python 3 deliberately changed some older behavior; new learners should use Python 3 rather than Python 2.

The Python Software Foundation was established in 2001. Python is now developed by a broad community of contributors. Its name refers to Monty Python, not a technical acronym. The language has grown through a documented proposal process, including Python Enhancement Proposals (PEPs).

How your program runs

An interpreter is the program that runs your Python code. The editor is where you write it; installing an editor does not necessarily install an interpreter. A terminal is a separate interface for starting programs and reading their output.

CPython, the implementation commonly installed from python.org, parses source code and compiles it to bytecode, then executes that bytecode in its runtime. This is why “interpreted” does not mean “never compiled.” Other Python implementations can use different execution techniques.

In an interactive shell, you enter a statement at the >>> prompt and see the result immediately. In a script, you save statements in a .py file and ask Python to run the file. Syntax errors prevent that code from starting; runtime exceptions can occur after earlier statements have already run.

Imports may create cached .pyc bytecode in __pycache__; these are generated files, not the source you normally edit. .pyw is used for windowed scripts on Windows, and .pyi files describe type interfaces. A Jupyter .ipynb file is a notebook document containing cells and metadata, not a plain Python script.

What people build with Python

ApplicationHow Python helpsWhat else is involved
Web developmentFrameworks organise request handling, validation and database access.HTML/CSS/JavaScript for the browser, plus hosting and security.
AI and machine learningLibraries expose model training, prediction and AI service APIs.Data quality, evaluation, computing resources and privacy decisions.
Data scienceScripts clean, combine, analyse and visualise datasets reproducibly.Statistics and knowledge of the data; a chart alone is not evidence.
Automation and scriptingPrograms repeat file-processing, reporting and integration tasks.Permissions, error handling and safe handling of real files.
Scientific computingNumerical libraries delegate heavy calculations to efficient compiled routines.Mathematical models and checks on precision and assumptions.
TestingAssertions and test runners check behavior repeatedly.Representative cases, controlled dependencies and clear expected results.
Desktop applicationsGUI toolkits provide windows, widgets and event handling.A desktop runtime and distribution tools; not the browser Playground.

Advantages, limits and other languages

Readable syntax, an interactive shell, built-in collections and extensive libraries make it possible to get useful results with small programs. These features help beginners experiment, but readability still depends on clear names, small steps and testing.

Dynamic typing can make experimentation quick, while some type mistakes appear only when a path runs. Optional type hints and checking tools help but do not automatically enforce all values at runtime. Python also uses memory for its runtime and objects; it is not always the best choice for tight memory budgets or hard real-time deadlines.

Pure-Python CPU-intensive loops often run slower than equivalent compiled native code. Libraries can move expensive work into native implementations. Concurrency and threading behavior depend on the Python build and libraries; do not assume threads automatically accelerate CPU-bound work.

JavaScript runs natively in web browsers; Python normally needs its own runtime (or a browser port such as Pyodide). Java and C# commonly use static checking and managed runtimes; C++ gives more direct control over memory. These are tradeoffs, not a ranking: choose a language whose ecosystem and deployment model fit the task.

Supported Python versions

Verified against the Python Developer’s Guide on 18 October 2026. Python 3.15 is the latest stable release line at this check. Install the newest patch of a supported line that your tools and required packages support. A newly released language version can arrive before every third-party package supports it.

Upstream security-only releases generally provide source releases rather than new official binary installers. Operating-system vendors may maintain their own packages on a different schedule. The table describes upstream CPython support, not every vendor’s support promise.

Release lineUpstream status at review
3.15 and 3.14Bug fixes and security fixes
3.13, 3.12 and 3.11Security fixes only
3.10 and older, including Python 2End of upstream support
3.16In development; not the beginner stable recommendation

Choose one editor

For a simple learning environment, Thonny is a good starting option; its Windows and macOS installers include Python. IDLE is a small editor often included with an official Python installation. VS Code is useful when you work with several languages, and PyCharm provides an integrated Python project workflow.

Choose Jupyter when working with exploratory calculations, charts and written notes. Its cells retain state, so learning to rerun a notebook from a clean kernel matters. You can change tools later without relearning the language.

Understand your first program

The example below calls print with the string "Hello, Python!". Run it and expect one line: Hello, Python! The quotes mark the text in the source and do not appear in the output. Python is case-sensitive: Print is a different name from print.

Change the message, run it again, then add a second print call. Check that both lines appear in order. If you see a SyntaxError, check matching quotes and parentheses; read the error location before changing unrelated lines. This small edit–run–check cycle is how you will learn the larger topics.

Syntax

print("Hello, Python!")

Examples

Your first Python program

Save as hello.py in your project folder. Expected output: Hello, Python!

print("Hello, Python!")
  1. print is a built-in function that writes to the output stream.
  2. The quoted text is a string. The quotes are not printed.
  3. Parentheses pass that string to print. No extra package is required.

Python: background & uses

Used for
Automation, Data and AI, Backend services
Created by
Guido van Rossum at CWI
First released
1991 · first public release
Version / standard
Python 3.15

Latest stable line at the review date. See the overview for other supported releases and package compatibility.

In the real world

  • Netflix: Data workflows and platform tooling
  • Spotify: Klio audio and data pipelines
  • LinkedIn: Offline generative-AI workflows

Facts checked 18 October 2026. Product links describe documented uses.

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

Specifications & further reading