Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.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.012 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'python.': 0.02; 'output': 0.05; 'odd': 0.07; 'follows.': 0.09; 'integers': 0.09; 'cc:addr :python-list': 0.11; 'subject:Help': 0.11; 'calculates': 0.16; 'iteration': 0.16; 'skip:[ 40': 0.16; 'demonstrate': 0.16; 'student': 0.16; 'wrote:': 0.18; 'written': 0.21; 'input': 0.22; 'cc:addr:python.org': 0.22; 'print': 0.22; 'integer': 0.24; 'question': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'appreciated': 0.26; 'values': 0.27; 'header:In-Reply-To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; 'url:mailman': 0.30; 'consisting': 0.31; 'formed': 0.31; 'python.org': 0.32; 'url:python': 0.33; '"the': 0.34; 'received:google.com': 0.35; 'add': 0.35; 'url:listinfo': 0.36; 'doing': 0.36; 'hi,': 0.36; 'url:org': 0.36; 'should': 0.36; 'example,': 0.37; 'positive': 0.37; 'list': 0.37; 'nov': 0.38; 'pm,': 0.38; 'university': 0.39; 'url:mail': 0.40; 'how': 0.40; 'even': 0.60; 'email addr:gmail.com': 0.63; 'repeat': 0.74; 'friend': 0.79; 'algorithm,': 0.84; 'maths': 0.84; 'subject:Friend': 0.91; 'to:none': 0.92; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type:content-transfer-encoding; bh=qHHQDN1Ze/D8wbyWTajASAfD/PfEIxv9XPZkuOLhcRI=; b=SltHIfT1kqmEe3v+eqG4/gpA2OLMVn5tTPXuMg7SaY5IhcYtK7oZXxSJ6fgpl6xLE/ cuBwRlGlQZBjdyxLa+g5v/1kssknjLZFtXCy4dRRoXaLV2wJjp03NVI9hN/BH1w4tPt+ dd1B/yuhytsNUouA4NeWvupZ3KBzp7Agau9uaJyKic43euiMo0TtNPoyRROQpXvr8hZ+ Qdy4RT+JdmXlZLDKqHBKa3mFgJiOO66rctSp9S7NFaCbVlFeu+tW2MKrrOnl3GYifqw8 obblXJuk4dB0Lj9YgyXCushdczS5Q46ekLo2QbaSN2UB/lAlkEwUHTaxMPp+RGDArho8 UNNw== MIME-Version: 1.0 X-Received: by 10.194.94.137 with SMTP id dc9mr3262186wjb.38.1384888055850; Tue, 19 Nov 2013 11:07:35 -0800 (PST) In-Reply-To: <0e127888-4bfa-4f14-aa55-df8ef53284a3@googlegroups.com> References: <0e127888-4bfa-4f14-aa55-df8ef53284a3@googlegroups.com> Date: Tue, 19 Nov 2013 14:07:35 -0500 Subject: Re: Newbie - Trying to Help a Friend From: Neil Cerutti Cc: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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: 71 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1384888062 news.xs4all.nl 15915 [2001:888:2000:d::a6]:58679 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:60024 bradleybooth12345@gmail.com via python.org asks: > A Friend is doing maths in University and has had some > coursework to do with python. > > The question is > > "Write a program that calculates how many positive integers > less than N are not divisible by 2,3 or 5. The user should be > prompted to supply the Number N. Demonstrate your program > output when the input N is your student id. (13006517) > > "The collatz process is as follows. Take a positive integer n > greater than 1. while n is greater than 1 repeat the following; > if N is even halve it and if N is odd multiply it by 3 and add > 1. The (Unsolved) collatz conjecture is that this process > always terminates. > > The user should be prompted to supply the number n, and your > program should build the list of values taken by sucessive > iteration of the algorithm, and print it out. For example, if 7 > is input your program should print the list > > [7,22,11,34,17,52,26,13,40,20,10,5,16,8,4,2,1] > > Demonstrate your program output for an input value consisting > of the number formed adding 10 to the last digit of your > student id. (13006517)" > > Any help would be appreciated What has A Friend written so far? Where are you stuck? --=20 Neil Cerutti On Tue, Nov 19, 2013 at 1:40 PM, wrote: > Hi, > > A Friend is doing maths in University and has had some coursework to do w= ith python. > > The question is > > "Write a program that calculates how many positive integers less than N a= re not divisible by 2,3 or 5. The user should be prompted to supply the Num= ber N. Demonstrate your program output when the input N is your student id.= (13006517) > > "The collatz process is as follows. Take a positive integer n greater tha= n 1. while n is greater than 1 repeat the following; if N is even halve it = and if N is odd multiply it by 3 and add 1. The (Unsolved) collatz conjectu= re is that this process always terminates. > > The user should be prompted to supply the number n, and your program shou= ld build the list of values taken by sucessive iteration of the algorithm, = and print it out. For example, if 7 is input your program should print the = list > > [7,22,11,34,17,52,26,13,40,20,10,5,16,8,4,2,1] > > Demonstrate your program output for an input value consisting of the numb= er formed adding 10 to the last digit of your student id. (13006517)" > > Any help would be appreciated > -- > https://mail.python.org/mailman/listinfo/python-list --=20 Neil Cerutti