Bill Bell wrote:
> Hello all,
>
> I am teaching an adult who is struggling (and I mean struggling) to
> learn how to expand and simplify algebraic expressions. I have been
> using sympy to produce solutions for randomly produced examples using
> '.expand.' But there has to be a better way of getting expressions
> 'in' to sympy.
>
> I have been writing things like
>
> (5*(3*x-10)-4*(6-2*x)). expand()
>
> How can I pass a string such as '5*(3*x-10)-4*(6-2*x)' to /expand/ for
> processing, please?
>
> Bill
>
> --
> Bill Bell, C.D.P.
> Blog: http://unsymptomatictoo.blogspot.com/
> LinkedIn profile - http://www.linkedin.com/in/williambell
> >
>
>   
Use the fact that python can execute itself.  Write a python script that 
predefines all the single letters as symbols.  Read in the string you 
want to expand.  Use the eval function on the string and expand and 
print what eval returns.  If eval does not work look up exec.  Always 
let python be it own parser.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sympy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to