Python complaints

Gareth McCaughan Gareth.McCaughan at pobox.com
Thu Nov 25 21:52:26 CET 1999


Charles Waldman wrote:

> You can often (ab)use dictionaries to get a ?:-like effect, as in this 
> construction:
> 
> def p(score):
>     print "You scored %d point%s" % (score, {1:''}.get(score,'s'))

That's disgusting. But very neat. :-)

-- 
Gareth McCaughan  Gareth.McCaughan at pobox.com
sig under construction




More information about the Python-list mailing list