I have list:
test_list = ['one','two',None]
Is there any simple way to replace None with 'None' ,without using index, because index for None maybe different each time.
I tried :
conv = lambda i : i or 'None'
res = [conv(i) for i in test_list]
It works ,is there another way to do so ?
conv = lambda i : i or 'None'and use that expression in the list comprehension?i or 'None'can be too broad. It will turn more than justNoneinto a string.''and0would also be converted to string'None'.