[Edu-sig] What was that syntax again?
kirby urner
kirby.urner at gmail.com
Tue Aug 15 18:51:19 CEST 2006
Yes, thank you. I was forgetting that this is ordinary function
syntax, with assignment (dict being the function). I was trying to do
it with curly braces.
Kirby
On 8/15/06, John Zelle <john.zelle at wartburg.edu> wrote:
> 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