3 ms·
You can now get the first item by abusing the walrus operator, e.g. `any((z := x) for x in [3,5,7] if x % 3)` -- afterwards, z have retained the first assignmen
by Erwin 5y ago
You can now get the first item by abusing the walrus operator, e.g. `any((z := x) for x in [3,5,7] if x % 3)` -- afterwards, z have retained the first assignment for which `x % 3` was true.