string % dictionary question

Sam Sungshik Kong ssk at chol.nospam.net
Tue Sep 14 02:10:33 CEST 2004


Hello, group!

<code>
>>> di={}
>>> di["test"]=None
>>> s="%(test)s" % di
>>> s
'None'
</code>

I want the result to be just empty string when the dictionary value is None.
Is there a good way?

TIA.
Sam





More information about the Python-list mailing list