Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed1.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.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'english.': 0.04; 'from:addr:yahoo.co.uk': 0.04; 'true,': 0.05; 'test,': 0.07; 'ambiguity': 0.09; 'integers': 0.09; 'lawrence': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'tismer': 0.09; 'subject:Help': 0.11; 'python': 0.11; 'suggest': 0.14; 'posted': 0.15; '120,': 0.16; '5),': 0.16; '60,': 0.16; 'precedence': 0.16; 'project)': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'specifying': 0.16; 'applies': 0.16; 'language': 0.16; 'wrote:': 0.18; 'wed,': 0.18; 'trying': 0.19; '(the': 0.22; '>>>': 0.22; 'example': 0.22; 'programming': 0.22; 'header:User-Agent:1': 0.23; 'question': 0.24; 'second': 0.26; 'gets': 0.27; 'header:X-Complaints-To:1': 0.27; 'header:In- Reply-To:1': 0.27; 'correct': 0.29; "doesn't": 0.30; '13,': 0.31; '>>>>': 0.31; 'apparently': 0.31; "d'aprano": 0.31; 'lessons': 0.31; 'steven': 0.31; 'quite': 0.32; '(i.e.': 0.33; 'trouble': 0.34; "i'd": 0.34; 'late': 0.35; 'point.': 0.35; 'test': 0.35; 'but': 0.35; 'there': 0.35; 'next': 0.36; 'responsible': 0.36; 'should': 0.36; 'positive': 0.37; 'two': 0.37; 'clear': 0.37; 'step': 0.37; 'christian': 0.38; 'nov': 0.38; 'to:addr:python- list': 0.38; 'does': 0.39; 'expensive': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'how': 0.40; 'even': 0.60; 'course.': 0.60; 'dave': 0.60; 'most': 0.60; 'numbers': 0.61; 'world.': 0.61; 'first': 0.61; 'real': 0.63; 'personal': 0.63; 'places': 0.64; 'great': 0.65; 'series': 0.66; 'world': 0.66; 'believe': 0.68; 'tasks.': 0.68; 'therefore': 0.72; '"not': 0.84; '49.': 0.84; 'writing,': 0.84; 'angel': 0.91; 'states,': 0.91; 'subject:Friend': 0.91; 'remember,': 0.93; '2013': 0.98 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Mark Lawrence Subject: Re: Newbie - Trying to Help a Friend Date: Wed, 20 Nov 2013 13:57:30 +0000 References: <0e127888-4bfa-4f14-aa55-df8ef53284a3@googlegroups.com> <528bff92$0$29992$c3e8da3$5496439d@news.astraweb.com> <528c31e9$0$11089$c3e8da3@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: host-78-147-20-216.as13285.net User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 In-Reply-To: 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: 56 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1384955871 news.xs4all.nl 15923 [2001:888:2000:d::a6]:34841 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:60076 On 20/11/2013 09:29, Alister wrote: > On Wed, 20 Nov 2013 00:54:28 -0500, Dave Angel wrote: > >> On 20 Nov 2013 03:52:10 GMT, Steven D'Aprano >> wrote: >>> 2 does count because it isn't divisible by 3. The question states, >>> "[count] how many positive integers less than N are not divisible >> by 2,3 >>> or 5". Two is not divisible by 3, so "not divisible by 2,3 or 5" is >> true, >>> so two gets counted. >> >>> The first number which is divisible by *all* of 2, 3 and 5 (i.e. >> fails >>> the test, and therefore doesn't get counted) is 30. The next few >> that >>> fail the test are 60, 90, 120, 150, 180, 210, 240, 270, 300, ... >>> Remember, these are the numbers which should not be counted. >> >>>> I count 1, not 6 >> >>> Out of curiosity, which number did you count? >> >> 1 of course. It's the only one that's not divisible by any of the >> factors. >> >> Apparently we disagree about precedence and associativity in English. >> I believe the not applies to the result of (divisible by 2, 3, or 5), >> so I'd count 1, 7, 11, 13, 17, 19, 23. The first nonprime would be 49. >> >> If I were trying to get the series you describe, I'd phrase it as >> "Not divisible by 2, and not divisible by 3, and not divisible by 5" > > This ambiguity is a great example of why teachers (and enayone else > responsible for specifying a programming project) should take greater > care when specifying tasks. > if it is to late to ask for clarification (the correct step in a real > world case) I suggest you write 2 programs 1 for each interpretation, it > will be good for your personal learning even if the teacher does not give > any extra credit. > Ambiguity is the reason that some of the most expensive language lessons in the world are at places like Sandhurst and West Point. Giving crystal clear orders, whether verbally or in writing, is considered quite important in the military. By the way, this is double posted and there were four identical messages from you yesterday, finger trouble or what? :) -- Python is the second best programming language in the world. But the best has yet to be invented. Christian Tismer Mark Lawrence