vsoler wrote:
Hi,

I have two dicts

n={'a', 'm', 'p'}
v={1,3,7}

Those aren't dicts, they're sets.

and I'd like to have

a=1
m=3
p=7

that is, creating some variables.

How can I do this?

The real question is not how, but why?

Anyway, assuming you want them to be global variables:

    globals().update(dict(zip(n, v)))

On my machine the variables didn't get the correct values because, as I
said, 'n' and 'v' are sets, so the order of the members is arbitrary.
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to