beginner <[EMAIL PROTECTED]> wrote:
> I'd like to do the following in more succint code:
> 
> if k in b:
>     a=b[k]
> else:
>     a={}
>     b[k]=a

b.setdefault(k, a)

-- 
Lawrence, oluyede.org - neropercaso.it
"It is difficult to get a man to understand 
something when his salary depends on not
understanding it" - Upton Sinclair
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to