'str' object has not attribute 'subs'
Question: Here is my Python code written in Vim. Whenever I run it, I get the error
`'str' object has not attribute 'subs'`

    
    
    from sympy import *
    x,a_test,b_test,fa_test,fb_test=symbols('x a_test b_test fa_test fb_test')
    expr=raw_input("enter the equation")
    print expr
    print "hello"
    try:
        print "hello"
        inc=0
        a=inc
        fa=expr.subs(x,inc)
        print "hello"
        if(fa<0):
            print "hello"
            inc+=1
            fb=expr.subs(x,inc)
            if(fb<=0):
                while(fb<=0):
                    inc+=1
        else:
            print "hello"
            inc+=1
            fb=expr.subs(x,inc)
            if(fb<=0):
                while(fb<=0):
                    inc+=1
        b=inc
        print a
        print b
        print fa
        print fb
    except Exception,e:
        print e
    


Answer: The return value of `raw_input` is a `str`; you cannot use it as if it is a
SymPy `expr`. You need to
[parse](http://docs.sympy.org/dev/modules/parsing.html) it first:

    
    
    from sympy.parsing.sympy_parser import parse_expr
    ...
    expr = parse_expr(raw_input("enter the equation"))
    

