Python 3 Tutorial chapters
  1. 01Python Basics & Environment Setup
  2. 02Operators & Expressions
  3. 03Control Flow & Loops
  4. 04Functions & Scope
  5. 05Data Structures: Lists & Tuples
  6. 06Dictionaries & Sets
  7. 07Strings & Text Processing
  8. 08Object-Oriented Programming (OOP)
  9. 09File Handling & I/O
  10. 10Exception Handling
  11. 11Advanced Python: Iterators & Decorators
  12. 12Modules & Virtual Environments

Chapter 2

Operators & Expressions

5 topics in 1 parts

Key ideas

Input Size (n) → Time (T) ↑ O(1) O(log n) O(n) O(n log n) O(n²) O(2ⁿ)
Operators & Expressions
Pattern / FeatureIdiomatic Pythonic ApproachSub-optimal Anti-pattern
Data ProcessingComprehensions & Generators (Memory efficient)Manual loops with repeated append calls
Resource HandlingContext Managers (with statement)Manual open() and close() calls
Type AnnotationsType hinting via typing moduleUnannotated dynamic parameters
Dictionary Lookupsdict.get(key, default) or defaultdictKey check followed by indexed access

All 5 topics in Operators & Expressions

  1. Operators

    • Arithmetic & Modulo Operators
    • Comparison & Relational Operators
    • Logical Operators & Short-circuiting
    • Bitwise Operators
    • Identity (is) vs Membership (in)