Learn how to download and install Python on Windows, macOS, and Linux, verify your installation, and launch the interactive REPL.
Tutorial series
Python Fundamentals
15 tutorials — follow in order for the best learning path.
- Installing Python on Your Computer
- Getting Started with Python
Write and run your first Python script, use the interactive REPL, and learn about print(), comments, strings, and numbers.
- Python Basics: Variables, Types, and Operators
Understand Python variables, naming conventions, core data types (int, float, str, bool), arithmetic and comparison operators, and f-strings.
- Control Flow: if, for, and while in Python
Learn how to make decisions with if/elif/else, iterate with for and while loops, and control loop execution with break and continue.
- Writing Functions in Python
Learn how to write functions in Python — the building blocks of reusable code. Master def, parameters, return values, and best practices.
- Lists, Tuples, and Dictionaries
Master Python's core data structures—lists, tuples, and dictionaries—and learn when to use each one for effective programming.
- Modules and Imports
Learn how to organize your Python code into modules and packages, master the import system, and leverage the powerful standard library.
- Classes and Objects
Learn object-oriented programming in Python with classes and objects. Create your own types, define methods, and build reusable components.
- Reading and Writing Files in Python
Learn how to read from and write to files in Python using built-in functions and pathlib. Covers text and binary files, context managers, and common patterns.
- Handling Errors and Exceptions
Learn how to handle errors and exceptions in Python using try, except, else, and finally. Includes raising exceptions and best practices.
- List, Dict, and Set Comprehensions
Learn how to use list, dict, and set comprehensions in Python. Covers basic syntax, filtering, and nested loops.
- *args and **kwargs Explained
Learn how to use *args and **kwargs in Python to write flexible functions that accept any number of positional and keyword arguments.
- How to Join a List into a String in Python
Learn how to convert a list to a string in Python using str.join() with practical examples for different data types and separators.
- String Formatting with f-strings in Python
Learn how to use f-strings to embed variables and expressions inside strings, format numbers with precision, and compare with other formatting methods
- Recursion in Python
Learn how to write recursive functions in Python, understand base cases and recursive cases, and see practical examples like factorial and Fibonacci.