%

Phil Hunt philh at vision25.demon.co.uk
Thu Apr 29 21:30:12 EDT 1999


Consider the % operator, eg:

    'All %(a)s eat %(b)s' % {'a':'cows', 'b':'grass'}

If the dictionary doesn't have all the relevant keys, an error
occurs. Is it possible for me to change the behaviour of this so that
if a key doesn't occur a default value of '' is assumed? 


-- 
Phil Hunt....philh at vision25.demon.co.uk





More information about the Python-list mailing list