title: Python eval() syntax error when trying to evaluate an expression
body: <p>I am having trouble with the eval() Python function in this code:</p>
  
  <pre><code> f = 'x'
   f = raw_input('f(x)=')
  
  def ytest(y,x,f):
      if y &gt;= eval(f)
          return 1
      else
          return 0
  </code></pre>
  
  <p>I know that eval() is a bad way to do this, but I am the only person who will ever be using my simple program. Whenever I try to run this I get the error:</p>
  
  <pre><code>  File "C:\Users\Grant\Desktop\Plotter\plotter.py", line 9
      if y &gt;= eval(f)
                    ^
  SyntaxError: invalid syntax
  </code></pre>
  
  <p>Why is this causing an error? If f is a valid python expression in string form, shouldn't the code be valid?</p>
  
  <p>the error also happens when I replace eval(f) with eval('0') so I can't figure out what the problem is.</p>