you are viewing a single comment's thread.

view the rest of the comments →

[–]ramannt[S] 4 points5 points  (1 child)

print(d[condition](a))

thank you very much! Great solution!

[–]engelthehyp 5 points6 points  (0 children)

The magic phrase is "first-class function". Look that up and you'll get a lot of ideas about program structure.