title: How to take a user defined function as user input in python?
body: <p>I am trying to write a program to define user-defined function with return expression as input from user.
  Suppose a function should return x+y.In python we can do it as---</p>
  
  <pre><code>def f(x,y):
   return x+y
  </code></pre>
  
  <p>But,i want something like</p>
  
  <pre><code>a=input("enter the function:")
  def f(x,y):
    return a
  print f(2,3)
  </code></pre>
  
  <p>If i enter x+y as input of a,it will give 5.How can it be done in Python(without Sympy or raw_function along with eval())?</p>