Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
Something like this
new_list = ['None' if el is None else el for el in example]
>>> x = ['1', '2', None]
>>> [str(i) for i in x]
['1', '2', 'None']
>>>
>>> [str(i) if i is None else i for i in x]
['1', '2', 'None']
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question