How to say $a=$b->{"A"} ||={} in Python?
beginner
zyzhu2000 at gmail.com
Thu Aug 16 18:35:50 EDT 2007
More information about the Python-list mailing list
Thu Aug 16 18:35:50 EDT 2007
- Previous message (by thread): How to say $a=$b->{"A"} ||={} in Python?
- Next message (by thread): How to say $a=$b->{"A"} ||={} in Python?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi All.
I'd like to do the following in more succint code:
if k in b:
a=b[k]
else:
a={}
b[k]=a
a['A']=1
In perl it is just one line: $a=$b->{"A"} ||={}.
Thanks,
Geoffrey
- Previous message (by thread): How to say $a=$b->{"A"} ||={} in Python?
- Next message (by thread): How to say $a=$b->{"A"} ||={} in Python?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list