Teks sumber — English
Terjemahan — Bahasa Indonesia
List Comprehensions
Daftar *List* *Comprehensions*
List comprehensions provide a concise way to create lists. Common applications are to make new lists where each element is the result of some operations applied to each member of another sequence or iterable, or to create a subsequence of those elements that satisfy a certain condition.
Pemahaman daftar *list comprehensions* menyediakan cara singkat untuk membuat daftar. Aplikasi umum adalah membuat daftar baru di mana setiap elemen adalah hasil dari beberapa operasi yang diterapkan pada setiap anggota dari urutan lain atau *iterable*, atau untuk membuat urutan elemen-elemen yang memenuhi kondisi tertentu.
List comprehensions can contain complex expressions and nested functions::
Pemahaman daftar *list comprehensions* dapat berisi ekspresi kompleks dan fungsi bersarang::
Nested List Comprehensions
Pemahaman Daftar *List Comprehensions* Bersarang
Unpacking in Lists and List Comprehensions
Unpacking can also be used in list comprehensions, as a way to build a new list representing the concatenation of an arbitrary number of iterables::
Similarly to :ref:`list comprehensions <tut-listcomps>`, set comprehensions are also supported, including comprehensions with unpacking::