clean_cells(cells) that strips each cell and drops the ones that are empty after stripping — one comprehension, order preserved.clean_cells([' alice ', '', ' ', 'bob'])
['alice', 'bob']
Whitespace-only cells vanish; survivors are stripped.
A stripped empty string is falsy.
You may call .strip() twice, or use the walrus operator to strip once.