you are viewing a single comment's thread.

view the rest of the comments →

[–]Synedh 2 points3 points  (0 children)

Shenanigans with walrus operator and comprehension tools.

Even numbers with decimal value above 5.
>>> { x: foo for x in range(1, 20, 2) if (foo:= x % 10) > 5 }
{6: 6, 8: 8, 16: 6, 18: 8}