[Edu-sig] What was that syntax again?
John Zelle
john.zelle at wartburg.edu
Tue Aug 15 15:21:49 CEST 2006
Is this what you're looking for:
>>> d = dict(key1=52, key2=12)
>>> d
{'key2': 12, 'key1': 52}
Of course this only works for keys that are strings.
--John
On Tuesday 15 August 2006 1:28 am, kirby urner wrote:
> Someone (Dethe? Ian?) showed me syntax I'd never seen before around
> Python dictionary defining, involving an equal sign I thought. Tried
> searching my gmail, other things. Maybe faster to just ask: what was
> that syntax again?
>
> Kirby
> _______________________________________________
> Edu-sig mailing list
> Edu-sig at python.org
> http://mail.python.org/mailman/listinfo/edu-sig
--
John M. Zelle, Ph.D. Wartburg College
Professor of Computer Science Waverly, IA
john.zelle at wartburg.edu (319) 352-8360
More information about the Edu-sig
mailing list