How to do this? - newbie
tolot at utolot.toppoint.de
Fri Feb 11 01:27:44 CET 2000
Ronald L. <dilsavor at erinet.com> wrote:
> I am new to python and am quite excited about it. I spent much of last night
> writing my fist code snippet and I came across 1 thing which I could not
> figure out how to do.
> then how can I create an x of numerical type such that
>>>> print x
> - just using manipulations of a = ('x',1)
If I got you right, then exec is what you want: 'exec a+"="+str(a)'
(or 'exec "%s=%d"%(a,a)' ) will execute 'x=1'.
More information about the Python-list