Python: Elegant and efficient ways to mask a list Python: Elegant and efficient ways to mask a list python python