List comprehensions: Difference between revisions
Content added Content deleted
m (→horizontal list: added a SAY.) |
Alextretyak (talk | contribs) (Added 11l) |
||
Line 17: | Line 17: | ||
If the language has multiple ways for expressing such a construct (for example, direct list comprehensions and generators), write one example for each. |
If the language has multiple ways for expressing such a construct (for example, direct list comprehensions and generators), write one example for each. |
||
<br><br> |
<br><br> |
||
=={{header|11l}}== |
|||
{{trans|Python}} |
|||
<lang 11l>print(cart_product(1..20, 1..20, 1..20).filter((x, y, z) -> x ^ 2 + y ^ 2 == z ^ 2 & y C x .. z))</lang> |
|||
{{out}} |
|||
<pre> |
|||
[(3, 4, 5), (5, 12, 13), (6, 8, 10), (8, 15, 17), (9, 12, 15), (12, 16, 20)] |
|||
</pre> |
|||
=={{header|ABAP}}== |
=={{header|ABAP}}== |