Skip to main content Brad's PyNotes

Posts on Tutorial

  1. Tutorial: Errors and Exceptions

    TL;DR

    Python separates syntax errors (caught before running) from exceptions (caught during execution). The try/except/finally system lets you catch errors, recover gracefully, and guarantee cleanup code runs.

  2. Tutorial: Whetting Your Appetite

    TL;DR

    Python excels at automation and rapid development with its simple syntax, powerful features, and “batteries included” philosophy - perfect for getting things done quickly.

  3. Tutorial: An informal intro to Python

    TL;DR

    Python’s interactive interpreter lets you experiment immediately with numbers, strings, and lists using intuitive syntax and meaningful indentation.

    Interesting!

    Python uses indentation instead of braces to define code blocks - making the visual structure of your code match its logical structure!

  4. Tutorial: Input Output

    TL;DR

    Python provides multiple string formatting methods (f-strings, .format(), manual), file operations with context managers, and JSON serialization for data exchange.

    Interesting!

    F-strings can execute any Python expression inside the braces - you can even call functions and perform calculations right inside the string!

  5. Tutorial: Organizing and Reusing Code with Python Modules

    TL;DR

    Python modules are files containing Python code that can be imported and reused, organized into packages (directories with init.py), with various import styles (import, from…import, as) and special attributes like name and all.

  6. Tutorial: Classes - Object-Oriented Programming in Python

    TL;DR

    Python classes bundle data and functionality together, supporting inheritance, method overriding, and special methods for creating powerful, reusable object-oriented code.

    Interesting!

    Python’s “everything is an object” philosophy means even classes are objects - you can inspect class attributes, pass classes as arguments, and create classes dynamically at runtime.