Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!rt.uk.eu.org!feed.xsnews.nl!border-1.ams.xsnews.nl!xlned.com!feeder1.xlned.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!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.020 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; '"""': 0.05; 'assign': 0.07; 'subject:two': 0.07; 'python': 0.09; 'any.': 0.09; 'cc:addr :python-list': 0.10; 'itself.': 0.11; 'describing': 0.16; 'subject:Problems': 0.16; 'subject:questions': 0.16; 'subject:these': 0.16; 'wrote:': 0.17; 'integer': 0.17; 'cc:2**0': 0.23; 'statement': 0.23; 'cc:no real name:2**0': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'header :User-Agent:1': 0.26; 'factor': 0.29; 'problem': 0.33; 'version': 0.34; 'nov': 0.35; 'returning': 0.35; 'pm,': 0.35; "didn't": 0.36; 'should': 0.36; 'does': 0.37; 'subject:: ': 0.38; 'positive': 0.38; 'received:192': 0.39; 'received:192.168': 0.40; "you've": 0.61; 'show': 0.63; 'header:Reply-To:1': 0.68; 'received:74.208': 0.71; 'reply-to:no real name:2**0': 0.72; 'received:74.208.4.194': 0.84; 'dennis': 0.91; 'angel': 0.93; 'factors': 0.95 Date: Mon, 19 Nov 2012 20:52:13 -0500 From: Dave Angel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121011 Thunderbird/16.0.1 MIME-Version: 1.0 To: Dennis Lee Bieber Subject: Re: Problems on these two questions References: <400c615f-4d93-4b8b-85ec-1bb4c47e30fe@googlegroups.com> <50A996EB.2000600@davea.name> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:xD1kW/Nk0X3jX3BK/R1lIEva9X6731jpzH+fgybJ1y4 lBMitISytBOiPvV4b/o7jfzpv8qpax7VSKYH/oDW+oioRUWH2N zt1j3VdqAtVZfstg7GF6nm19NKQddrXYznafI64PVFQmHkjsTD Qt1n3g7wknKoZ6/lrfjHl9uwyT87TA0xLZ+h1fkQACLCHSssgo rtOCATsgq6ZWun/r87iw8WCGywb2hNIfOrc71pfsqSsmegUFEi f42MtCLQ01omRcDq21YjOFstSdzorPoUyfOusyTDANv5sKytgC byNqm+COwtqOYS+hyPIhC1oShAHjruuNevg0Dufu35lthPLSg= = Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 28 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1353376363 news.xs4all.nl 6952 [2001:888:2000:d::a6]:37184 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:33579 On 11/19/2012 06:16 PM, Dennis Lee Bieber wrote: > On Sun, 18 Nov 2012 21:18:19 -0500, Dave Angel declaimed > the following in gmane.comp.python.general: > > >> if is_a_prime(n): >> is_prime = True >> >> Now all you have to do is write is_a_prime(). if you get stuck, please >> show us what you've got, and what the problem is with it. And as usual, >> tell us what version of Python you're writing in, if any. >> > Since "is_a_prime" is returning a Boolean, this condenses to: > > is_prime = is_a_prime(n) Nope, the original problem statement didn't say what should should happen if n does have such factors. Clearly, it's only describing a program fragment. """1.Given a positive integer n , assign True to is_prime if n has no factors other than 1 and itself. (Remember, m is a factor of n if m divides n evenly.) """ -- DaveA