How to replace all None values with the string "Null" in a dictionary

dcrespo dcrespo at gmail.com
Thu Oct 27 16:26:25 EDT 2005


Hi all,

How can I replace all None values with the string 'Null' in a
dictionary?

For example:
convert this:
a = {'item1': 45, 'item2': None}

into this:
a = {'item1': 45, 'item2': 'Null'}

Thanks

Daniel




More information about the Python-list mailing list