Posted on 16th September 2024|12 views
How to use if/else in list comprehension?
Posted on 16th September 2024| views
Here is one way that is easy
Example:
def change(z):
if z is None: return unicode(z.strip())
else: return ''
row = [change(b) for b in row]