Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed2.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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python.': 0.02; 'beginner': 0.05; 'output': 0.05; 'odd': 0.07; 'follows.': 0.09; 'integers': 0.09; 'received:67.192': 0.09; 'received:67.192.241': 0.09; 'received:dfw.emailsrvr.com': 0.09; 'subject:Help': 0.11; 'python': 0.11; 'question.': 0.14; 'assignment.': 0.16; 'assignments': 0.16; 'calculates': 0.16; 'iteration': 0.16; 'skip:[ 40': 0.16; 'demonstrate': 0.16; 'student': 0.16; 'wrote:': 0.18; 'code.': 0.18; 'input': 0.22; 'programming': 0.22; 'print': 0.22; 'header:User-Agent:1': 0.23; 'effort.': 0.24; 'integer': 0.24; 'received:emailsrvr.com': 0.24; 'question': 0.24; 'sort': 0.25; 'appreciated': 0.26; 'received:(smtp server)': 0.26; 'values': 0.27; 'gets': 0.27; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'programming.': 0.30; "i'm": 0.30; 'included': 0.31; 'lines': 0.31; 'consisting': 0.31; 'formed': 0.31; 'gary': 0.31; 'class': 0.32; "we're": 0.32; '"the': 0.34; 'add': 0.35; 'doing': 0.36; 'hi,': 0.36; 'should': 0.36; 'example,': 0.37; 'positive': 0.37; 'list': 0.37; 'requiring': 0.38; 'to:addr:python-list': 0.38; 'extremely': 0.39; 'sure': 0.39; 'to:addr:python.org': 0.39; 'university': 0.39; 'how': 0.40; 'even': 0.60; 'read': 0.60; 'simple': 0.61; 'email addr:gmail.com': 0.63; 'such': 0.63; 'side': 0.67; 'repeat': 0.74; 'friend': 0.79; 'algorithm,': 0.84; 'maths': 0.84; 'start.': 0.84; 'habit': 0.91; 'subject:Friend': 0.91 X-Virus-Scanned: OK Date: Tue, 19 Nov 2013 11:06:40 -0800 From: Gary Herron User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Newbie - Trying to Help a Friend References: <0e127888-4bfa-4f14-aa55-df8ef53284a3@googlegroups.com> In-Reply-To: <0e127888-4bfa-4f14-aa55-df8ef53284a3@googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; 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: 32 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1384888596 news.xs4all.nl 15896 [2001:888:2000:d::a6]:43152 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:60026 On 11/19/2013 10:40 AM, bradleybooth12345@gmail.com wrote: > Hi, > > 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 sort of help are you requesting? We're not in the habit of writing student assignments for them because they will learn nothing from such an effort. Your friend should read the book/lecture-notes/whatever, and make an attempt on the assignment. If he gets stuck, he may ask a specific Python question. I'm sure lots of help will follow. As a side note, these are extremely simple beginner problems, each requiring only a few lines of code. Any programming class that assigned these must have included some lectures on the basics of programming. That's where he should start. Gary Herron