Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
** Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement! **
List Comprehension¶
Notice that a walrus expression in a list comprehension must be in included in parentheses (to avoid ambiguitions).
arr = [1, 2, 3]
[val for e in arr if (val := e**2) > 3][4, 9]