Negative integers and string formating

Steven D'Aprano steve at REMOVEME.cybersource.com.au
Tue Oct 24 04:39:37 CEST 2006


On Mon, 23 Oct 2006 18:56:21 -0700, Paul Rubin wrote:

> Steven D'Aprano <steve at REMOVEME.cybersource.com.au> writes:
>> def display(**kwargs):
>>     fs = format(kwargs['argument'])
>>     return fs % kwargs
> 
>  def display(**kwargs):
>      fs = format(kwargs['argument'])
>      return fs % dict((x, abs(y)) for x,y in kwargs.iteritems())

That will do it! Thanks,

-- 
Steven




More information about the Python-list mailing list