List Comprehensions and Generator Expressions in Python
1.0
  • The Test Framework
  • List Comprehensions
  • Comprehensions and Loops: How They Differ
  • Generator Expressions
  • Set Comprehensions & Dictionary Comprehensions
  • When and When Not To Use Comprehensions
  • Exercise Answers

Trey Hunner does on-site Python training for teams. Read his writing here.

List Comprehensions and Generator Expressions in Python

List Comprehensions and Generator Expressions¶

This tutorial was taught by Trey Hunner at PyCon 2018. Trey corporate Python & Django training services.

The video for this tutorial can be found as “Using List Comprehensions and Generator Expressions For Data Processing” on YouTube.

Contents¶

  • The Test Framework
    • Where to write your code
    • How to run the tests
    • Passing the Tests
    • Getting Help
  • List Comprehensions
    • Loops Review
    • Basic Comprehensions
    • Conditional Filters
    • Readability
    • Comprehension Exercises
  • Comprehensions and Loops: How They Differ
    • When do we use them?
    • Nested Comprehensions
    • Take Another Look
  • Generator Expressions
    • Sum
    • Generator Expressions
    • Refactoring for Efficiency
    • Generator Review
    • Iteration Tools
    • Generator Expression Exercises
  • Set Comprehensions & Dictionary Comprehensions
    • Set Comprehensions
    • Dict Comprehensions
    • More Comprehension Exercises
  • When and When Not To Use Comprehensions
    • Uses
    • Non-Uses
    • Looking For Uses
    • Efficiency
    • Generator Functions
    • Extend and yield from
    • Scope
    • Scope Oddities
    • Advanced Exercises
  • Exercise Answers

Exercises¶

Exercise test files

Next

© Copyright 2018, Truthful Technology, LLC

Built with Sphinx using a theme provided by Read the Docs.