Skip to content

Latest commit

 

History

History
2 lines (2 loc) · 635 Bytes

README.md

File metadata and controls

2 lines (2 loc) · 635 Bytes

comprehensions-and-combinations

Python's comprehension syntax is a powerful language feature that, under the right circumstances, provides a way to implement workflows on collections (such as lists and sets) in a way that is concise and closely resembles widely used and recognized forms of mathematical notation. This article explores how comprehensions can be used as a foundational building block (that can be employed in conjunction with functions and recursion) to build concise solutions for problems that require defining or generating various kinds of combinations of all the elements from a finite (or infinite) collection.