 <p>As of Swift 2.x, there are a few short equivalents to your Python-style list comprehension.</p> <p>The most straightforward adaptations of Python's formula (which reads something like "apply a transform to a sequence subject to a filter") involve chaining the <code>map</code> and <code>filter</code> methods available to all <code>SequenceType</code>s, and starting from a <code>Range</code>:</p> <pre><code>// Python: [ x for x in range(10) if x % 2 == 0 ] let evens = (0..&lt;10).filter { $0 % 2 == 0 } // Another example, since the first with 'x for x' doesn't // use the full ability of a list comprehension: // Python: [ x*x for x in range(10) if x % 2 == 0 ] let evenSquared = (0..&lt;10).filter({ $0 % 2 == 0 }).map({ $0 * $0 }) </code></pre> <p>Note that a <code>Range</code> is abstract — it doesn't actually create the whole list of values you ask it for, just a construct that lazily supplies them on demand. (In this sense it's more like Python's <code>xrange</code>.) However, the <code>filter</code> call returns an <code>Array</code>, so you lose the "lazy" aspect there. If you want to keep the collection lazy all the way through, just say so:</p> <pre><code>// Python: [ x for x in range(10) if x % 2 == 0 ] let evens = (0..&lt;10).lazy.filter { $0 % 2 == 0 } // Python: [ x*x for x in range(10) if x % 2 == 0 ] let evenSquared = (0..&lt;10).lazy.filter({ $0 % 2 == 0 }).map({ $0 * $0 }) </code></pre> <p>Unlike the list comprehension syntax in Python (and similar constructs in some other languages), these operations in Swift follow the same syntax as other operations. That is, it's the same style of syntax to construct, filter, and operate on a range of numbers as it is to filter and operate on an array of objects — you don't have to use function/method syntax for one kind of work and list comprehension syntax for another.</p> <p>And you can pass other functions in to the <code>filter</code> and <code>map</code> calls, and chain in other handy transforms like <code>sort</code> and <code>reduce</code>:</p> <pre><code>// func isAwesome(person: Person) -&gt; Bool // let people: [Person] let names = people.filter(isAwesome).sort(&lt;).map({ $0.name }) let sum = (0..&lt;10).reduce(0, combine: +) </code></pre> <p>Depending on what you're going for, though, there may be more concise ways to say what you mean. For example, if you specifically want a list of even integers, you can use <code>stride</code>:</p> <pre><code>let evenStride = 0.stride(to: 10, by: 2) // or stride(through:by:), to include 10 </code></pre> <p>Like with ranges, this gets you a generator, so you'll want to make an <code>Array</code> from it or iterate through it to see all the values:</p> <pre><code>let evensArray = Array(evenStride) // [0, 2, 4, 6, 8] </code></pre> <p><sup><strong>Edit:</strong> Heavily revised for Swift 2.x. See the edit history if you want Swift 1.x.</sup></p>