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

    Master Python basics: variables, data types, and operators with clear examples. See how dynamic typing and f-strings make everyday coding cleaner.

  4. Control Flow: if, for, and while in Python

    Master Python control flow with if/elif/else decisions, for and while loops, break and continue statements, and the loop else clause for cleaner program logic.

  5. Writing Functions in Python

    Master writing functions in Python — covers def, parameters, return values, scope, args and kwargs, docstrings, and best practices for clean reusable code.

  6. Lists, Tuples, and Dictionaries

    Learn how Python's lists, tuples, and dictionaries work so you can pick the right one every time. Covers indexing, slicing, unpacking, and iteration patterns.

  7. Working with Python Modules and Imports

    Organize Python code into modules and packages, master the import system, and use the standard library effectively for building maintainable applications.

  8. Python Classes and Objects: A Beginner's Guide to OOP

    Learn Python classes and objects from scratch. Covers constructors, instance attributes, methods, and self with practical inventory and bank account examples.

  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

    Master handling errors in Python with try/except blocks, custom exceptions, and production-ready patterns for building applications that fail gracefully.

  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.