A simple (newbie) question.

David A. man_at_moon at hotmail.com
Mon Feb 19 15:08:42 EST 2001


Hello to everyone,

    maybe I have already sent this question to the group, but I am not sure
(the first one never reached the group I think). Anyway, I am a newbie, so
probably my question is a realy simple for the most experienced python
users.

Well what I want to is this:
>>> a='python'
>>> b='print'
>>> c=b+a
>>> eval(c)
Traceback (innermost last):
  File "<pyshell#19>", line 1, in ?
    eval(c)
  File "<string>", line 1
    print"python"
        ^
SyntaxError: invalid syntax
>>>

    Of course, what I wanted was that the eval(c) prints "python"!
what am I doing wrong? Any help is apreciated.

Thx in advance David Asfaha.
--
"Quidquid latine dictum sit, altum viditur."
Whatever is said in Latin sounds profound.







More information about the Python-list mailing list