castironpi a écrit :
On Aug 23, 7:25 pm, Gandalf <[EMAIL PROTECTED]> wrote:
how can I declare a variable with another variable name?
for example I will use PHP:
$a= "hello";
$a_hello="baybay";
print ${'a_'.$a) //output: baybay
how can i do it with no Arrays using python
thanks!
Here'
Le Sunday 24 August 2008 03:24:29 Terry Reedy, vous avez écrit :
> Gandalf wrote:
> > how can I declare a variable with another variable name?
> >
> > for example I will use PHP:
> >
> > $a= "hello";
> >
> > $a_hello="baybay";
> >
> > print ${'a_'.$a) //output: baybay
> >
> >
> > how can i do it
OK thank you all !
sometimes you just getting use to somethings...
--
http://mail.python.org/mailman/listinfo/python-list
Gandalf wrote:
how can I declare a variable with another variable name?
for example I will use PHP:
$a= "hello";
$a_hello="baybay";
print ${'a_'.$a) //output: baybay
how can i do it with no Arrays using python
Others have given you the direct answer. But using lists or dicts is
al
On Aug 23, 7:25 pm, Gandalf <[EMAIL PROTECTED]> wrote:
> how can I declare a variable with another variable name?
>
> for example I will use PHP:
>
> $a= "hello";
>
> $a_hello="baybay";
>
> print ${'a_'.$a) //output: baybay
Doing this sort of thing in Python is very anti idiom.
>
> how can i do
i don't know if this volatiles array condition or not
but any way
q='asd'
asdasd=20
print globals()[q+'asd']
--
http://mail.python.org/mailman/listinfo/python-list
On Aug 23, 7:25 pm, Gandalf <[EMAIL PROTECTED]> wrote:
> how can I declare a variable with another variable name?
>
> for example I will use PHP:
>
> $a= "hello";
>
> $a_hello="baybay";
>
> print ${'a_'.$a) //output: baybay
>
> how can i do it with no Arrays using python
>
> thanks!
Here's one
how can I declare a variable with another variable name?
for example I will use PHP:
$a= "hello";
$a_hello="baybay";
print ${'a_'.$a) //output: baybay
how can i do it with no Arrays using python
thanks!
--
http://mail.python.org/mailman/listinfo/python-list