Path: csiph.com!usenet.pasdenom.info!dedibox.gegeweb.org!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.045 X-Spam-Evidence: '*H*': 0.91; '*S*': 0.00; 'python': 0.11; '"standard': 0.16; 'didactic': 0.16; 'exponent': 0.16; 'inputs': 0.16; 'notation': 0.16; 'outputs': 0.16; 'somehow,': 0.16; 'wrote:': 0.18; 'trying': 0.19; 'basically': 0.19; 'meant': 0.20; 'input': 0.22; 'example': 0.22; 'header:User-Agent:1': 0.23; 'unicode': 0.24; 'math': 0.24; 'looks': 0.24; 'header:In-Reply- To:1': 0.27; 'characters': 0.30; 'gary': 0.31; 'something': 0.35; 'but': 0.35; 'like,': 0.36; 'hi,': 0.36; 'received:10': 0.37; 'depends': 0.38; 'solving': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'sure': 0.39; 'to:addr:python.org': 0.39; 'how': 0.40; 'read': 0.60; 'charset:windows-1252': 0.65; 'experience.': 0.67; 'institute': 0.72; 'received:10.10': 0.74; 'received:204': 0.75; 'dr.': 0.77 Date: Tue, 30 Sep 2014 14:05:23 -0700 From: Gary Herron User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 MIME-Version: 1.0 To: python-list@python.org Subject: Re: how to parse standard algebraic notation References: <4a7f3e7a-ba4d-405e-a078-937bf861fcd8@googlegroups.com> In-Reply-To: <4a7f3e7a-ba4d-405e-a078-937bf861fcd8@googlegroups.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 30 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1412111706 news.xs4all.nl 2841 [2001:888:2000:d::a6]:41887 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:78506 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 accomplish this in python (3.3) > > Do you have any ideas or suggestions? I don't want to use existing modules as this is meant to be a didactic experience. > > Regards This depends on things you have not yet told us. In particular -- what "standard algebraic notation"? For x-squared: x**2 ? or perhaps x^2 ? or something else like some Unicode characters or HTML to get a small superscript 2 above an x. Once you give an example of what your input looks like, we can start hashing out how to read it. Gary Herron -- Dr. Gary Herron Department of Computer Science DigiPen Institute of Technology (425) 895-4418