Re: how to parse standard algebraic notation

2014-10-01 Thread Chris Angelico
On Thu, Oct 2, 2014 at 2:45 AM, Steven D'Aprano wrote: > Code for evaluating mathematical expressions are very common, if you google > for "expression parser" I am sure you will find many examples. Don't limit > yourself to Python code, you can learn from code written in other languages > too, e.g

Re: how to parse standard algebraic notation

2014-10-01 Thread Steven D'Aprano
math math wrote: > Hi, > > I am trying to learn Python while solving exercises. > > I want to basically write a program that inputs a polynomial in standard > algebraic notation and outputs its derivative. > > I know that I need to get the exponent somehow, but I am not sure how to > accomplish

Re: how to parse standard algebraic notation

2014-10-01 Thread Marco Buttu
On 01/10/2014 09:01, math math wrote: What would be a good starting strategy for writing a program to take the derivative of a polynomial expression, such as this below?: "x**3 + x**2 + x + 1" You can look at sympy: >>> from sympy import * >>> equation = simplify("x**3 + x**2 + x + 1") >>> e

Re: how to parse standard algebraic notation

2014-10-01 Thread Marco Buttu
On 01/10/2014 09:01, math math wrote: What would be a good starting strategy for writing a program to take the derivative of a polynomial expression, such as this below?: "x**3 + x**2 + x + 1" You can look at sympy: >>> from sympy import * >>> equation = simplify("x**3 + x**2 + x + 1") >>> eq

Re: how to parse standard algebraic notation

2014-10-01 Thread math math
Thanks a lot, I will give this a shot. -- https://mail.python.org/mailman/listinfo/python-list

Re: how to parse standard algebraic notation

2014-10-01 Thread Chris Angelico
On Wed, Oct 1, 2014 at 5:01 PM, math math wrote: > What would be a good starting strategy for writing a program to take the > derivative of a polynomial expression, such as this below?: > "x**3 + x**2 + x + 1" > > I am a bit confused about my overall strategy. Should one be writing a parser > cl

Re: how to parse standard algebraic notation

2014-10-01 Thread Mark Lawrence
On 01/10/2014 08:01, math math wrote: [mega-snip] You are far more likely to get answers if you access this list via https://mail.python.org/mailman/listinfo/python-list or read and action this https://wiki.python.org/moin/GoogleGroupsPython to prevent us seeing double line spacing and single

Re: how to parse standard algebraic notation

2014-10-01 Thread math math
On Tuesday, 30 September 2014 23:15:24 UTC+2, Gary Herron wrote: > On 09/30/2014 01:53 PM, math math wrote: > > > Hi, > > > > > > I am trying to learn Python while solving exercises. > > > > > > I want to basically write a program that inputs a polynomial in standard > > algebraic notation a

Re: how to parse standard algebraic notation

2014-09-30 Thread Chris Angelico
On Wed, Oct 1, 2014 at 6:53 AM, math math wrote: > I want to basically write a program that inputs a polynomial in standard > algebraic notation and outputs its derivative. > > I know that I need to get the exponent somehow, but I am not sure how to > accomplish this in python (3.3) As Gary say

Re: how to parse standard algebraic notation

2014-09-30 Thread Gary Herron
On 09/30/2014 01:53 PM, math math wrote: Hi, I am trying to learn Python while solving exercises. I want to basically write a program that inputs a polynomial in standard algebraic notation and outputs its derivative. I know that I need to get the exponent somehow, but I am not sure how to a

how to parse standard algebraic notation

2014-09-30 Thread math math
Hi, I am trying to learn Python while solving exercises. I want to basically write a program that inputs a polynomial in standard algebraic notation and outputs its derivative. I know that I need to get the exponent somehow, but I am not sure how to accomplish this in python (3.3) Do you hav