0

My Python 3 code:

test = "c.mode=0; c.preview=False"
eval(test)

Output:

  File "<string>", line 1
    c.mode=0; c.preview=False
          ^
SyntaxError: invalid syntax

Why? It works fine at the REPL command prompt.

nerdfever.com
  • 1,652
  • 1
  • 20
  • 41

0 Answers0