python_wiki:list_comprehensions

This is an old revision of the document!


List Comprehensions

General Information

List comprehensions are a way to create lists based on lists.

They cut out a step in which you would create an intermediate list just to create a new list.

Checklist

  • Python 2 or 3

Usage

FIXME → Fill out list comprehension example and code.

Instructions here.

Execution code here

The Code

program-name.py
Program code here

  • python_wiki/list_comprehensions.1533271573.txt.gz
  • Last modified: 2019/05/25 23:50
  • (external edit)