On Mar 12, 8:02 pm, Jean-Michel Pichavant
wrote:
> Luis M. González wrote:
> > On Mar 12, 10:59 am,hiral wrote:
>
> >> Hi,
>
> >> Is there any way to create variables which name matches with dict key?
>
> >> For example:
> >> dict1 = {"abc":'1", "def":"2"}
>
> >> Now I am looking to have variable
On Fri, 12 Mar 2010 06:50:18 -0800 (PST) Luis M. González
wrote:
> The question is: should you do it?
And the answer is: No.
And the usual disclaimer is: (Unless you *know* it's the best possible
solution to your problem.)
/W
--
INVALID? DE!
--
http://mail.python.org/mailman/listinfo/pytho
Luis M. González wrote:
On Mar 12, 10:59 am, hiral wrote:
Hi,
Is there any way to create variables which name matches with dict key?
For example:
dict1 = {"abc":'1", "def":"2"}
Now I am looking to have variable name abc and it's value be '1' etc.
Pl. suggest.
Thank you.
Check out
On Mar 12, 10:59 am, hiral wrote:
> Hi,
>
> Is there any way to create variables which name matches with dict key?
>
> For example:
> dict1 = {"abc":'1", "def":"2"}
>
> Now I am looking to have variable name abc and it's value be '1' etc.
>
> Pl. suggest.
>
> Thank you.
Check out this thread (ver
hiral wrote:
Is there any way to create variables which name matches with dict key?
For example:
dict1 = {"abc":'1", "def":"2"}
Now I am looking to have variable name abc and it's value be '1' etc.
1) you can't because "def" is a reserved word in Python.
2) why do you want to? This seems to