undo a dictionary

mmm mdboldin at gmail.com
Wed Jul 30 21:14:31 CEST 2008


> > And for that matter a way to create a
> > dictionary from a set of variables (local or global).
>
> You have to be more specific: there are {} displays and dict(args) call
> and other methods.  Read the manual.

My desire is to take a set of data items in an alpha-numeric range and
oput them into a dictionary

i.e.,
x1=1
x2=20
x3=33

to yield  the dictionary

{ 'x1':1, 'x2':20, 'x3':33 }

without having to type in as above but instead invoke a function

maybe with syntax of

dd=make_dict('x1--x99')



More information about the Python-list mailing list