pyguides

Tutorial series

Python Fundamentals

15 tutorials — follow in order for the best learning path.

  1. Installing Python on Your Computer

    Learn how to download and install Python on Windows, macOS, and Linux, verify your installation, and launch the interactive REPL.

  2. Getting Started with Python

    Write and run your first Python script, use the interactive REPL, and learn about print(), comments, strings, and numbers.

  3. 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.

  4. 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.

  5. 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.

  6. Lists, Tuples, and Dictionaries

    Master Python's core data structures—lists, tuples, and dictionaries—and learn when to use each one for effective programming.

  7. Modules and Imports

    Learn how to organize your Python code into modules and packages, master the import system, and leverage the powerful standard library.

  8. Classes and Objects

    Learn object-oriented programming in Python with classes and objects. Create your own types, define methods, and build reusable components.

  9. 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.

  10. 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.

  11. List, Dict, and Set Comprehensions

    Learn how to use list, dict, and set comprehensions in Python. Covers basic syntax, filtering, and nested loops.

  12. *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.

  13. 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.

  14. 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

  15. 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.