Getting Started with Python
Install Python, write your first program, and understand the basics of running Python code.
Start your Python journey here. Learn the fundamentals step by step, from your first program to object-oriented programming.
Python Basics covers everything you need to write and read simple Python programs: installation, variables, data types, control flow, functions, and the most common data structures. We assume you have never programmed before or that you are coming from another language; explanations are kept clear and examples are runnable. If you see an error you do not understand, use the Errors & Exceptions index to look it up by name.
Start with Getting Started to install Python and run your first script. Then learn how to store and shape data: variables, data types, operators, and conditionals and loops for control flow. Functions let you reuse logic and structure larger programs. After that, focus on the structures you will use every day: lists, dictionaries, tuples, sets, and strings. With those in place, you can handle file handling, exception handling, modules, and later classes and objects and inheritance.
Each article builds on the previous ones. For quick task‑oriented recipes (e.g. read a CSV, call an API, loop with an index), see the How‑To guides. For deeper explanations of a single idea (e.g. list vs tuple, decorators, comprehensions), see Core Concepts. For “what does this error mean?”, use Errors & Exceptions.
Install Python, write your first program, and understand the basics of running Python code.
Learn how to store data in variables and understand Python's basic data types.
Arithmetic, comparison, logical, and assignment operators—how to use them all.
Make decisions in your code based on conditions.
Repeat code efficiently with for loops and while loops.
Create reusable blocks of code with functions.
Store and manipulate collections of items with lists.
Store key-value pairs and access data efficiently.
Manipulate text with string methods and formatting.
Read from and write to files in Python.
Handle errors gracefully with try, except, and finally.
Introduction to object-oriented programming in Python.