Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed6.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.042 X-Spam-Evidence: '*H*': 0.92; '*S*': 0.00; 'subject:Python': 0.05; 'python': 0.08; 'assert': 0.09; 'am,': 0.12; 'expression,': 0.16; 'syntaxerror:': 0.16; 'cc:addr:python-list': 0.16; 'syntax': 0.16; 'wrote:': 0.18; 'cc:no real name:2**0': 0.21; 'header:In-Reply- To:1': 0.22; 'math': 0.24; 'code': 0.26; 'invalid': 0.28; 'problem': 0.29; 'cc:addr:python.org': 0.29; 'header:User- Agent:1': 0.33; 'it.': 0.33; 'however,': 0.35; 'response': 0.36; 'cc:2**1': 0.36; 'received:192': 0.38; 'portion': 0.38; 'except': 0.39; 'might': 0.40; 'type': 0.61; 'your': 0.61; 'header:Reply- To:1': 0.70; 'reply-to:no real name:2**0': 0.72; '10:20': 0.84; 'quoting.': 0.84; 'remarks': 0.84 Date: Sun, 12 Feb 2012 12:00:33 -0500 From: Dave Angel User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111109 Thunderbird/3.1.16 MIME-Version: 1.0 To: inq1ltd Subject: Re: Numeric root-finding in Python References: <4f375f0f$0$29986$c3e8da3$5496439d@news.astraweb.com> <2276591.XVerqeASP3@mach-114-20> In-Reply-To: <2276591.XVerqeASP3@mach-114-20> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:nRBCAUvmzuzgfeCsvVt+KEYew78tHsFZvWNcCw3KueZ RUUt9WFlhZPo993ompx1yCbyGASTRpyH49yKcugXRHkpQTTIm7 RTo5GQVB5OR+3NK/HIeXLZ9HHeveAY5+vUdcRu2/O67JJQKkPW xy3gAwMyvs2N1iolOd8povoTg91apl1X63szfAHysLyaQEoVkA KAdAZ8yl4IPEpmlyKz2as5kL48zZh7IdGQYi4zflMX77gsl+cY iYkq+svAd72ihv+YoM7qdQHnfg1Z3U9A2bJ/rd8B/BILwqPX3G x8bwzZZID1HUnPJpVSQsYP/mSzhU3j0pfhV7l2z8EfeGtlCjXH 8l4X7k4CLy6QUyeGnyNA= Cc: python-list@python.org, Steven D'Aprano X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: d@davea.name 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: 24 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1329066049 news.xs4all.nl 6861 [2001:888:2000:d::a6]:46172 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:20280 On 02/12/2012 10:20 AM, inq1ltd wrote: > > I don't know the first thing about this math problem however, > > if I were to code this I might try ; > > except ZeroDivisionError: > assert w = -1 You top-posted. Please type your response after whatever you're quoting. In my case, I only need a portion of what you said, and my remarks are following it. assert takes an expression, so the one above is just wrong. Fortunately, Python would tell you with SyntaxError: invalid syntax -- DaveA