Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!news2.arglkargh.de!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder7.xlned.com!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.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'python.': 0.02; 'yet.': 0.04; 'variables': 0.07; 'seemed': 0.09; 'subject:number': 0.09; 'subject:script': 0.09; 'cc:addr:python-list': 0.11; 'subject:Help': 0.11; 'python': 0.11; 'wrote': 0.14; 'bit.': 0.16; 'count,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'loops': 0.16; 'wrote:': 0.18; 'version.': 0.19; 'written': 0.21; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'updating': 0.26; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; 'getting': 0.31; 'run': 0.32; 'another': 0.32; 'sense': 0.34; 'subject:the': 0.34; 'problem': 0.35; 'subject:with': 0.35; 'something': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'version': 0.36; 'useful': 0.36; 'thanks': 0.36; 'should': 0.36; 'system,': 0.38; 'pm,': 0.38; 'subject:" ': 0.39; 'even': 0.60; 'new': 0.61; 'course': 0.61; "you'll": 0.62; 'more': 0.64; 'holding': 0.65; 'mar': 0.68; 'brand': 0.72; 'to:none': 0.92; 'scott': 0.93 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=BP8o7K4Caa9wgbotZsATKEvrmwrVHIQbwOah/BsIDmQ=; b=khnabD6r+N0/N6QKNI1PiJ3I4Sy2UMF+7osULB85zj518v6gQK/GXJRfEaQMN7KnkG oPsJulLa0EQOdKX1XJBAQ9pZ2HlN6lgeHF3CpVXafWAQEwDtYnnlmASydji1Eq/4dmdT EVdJV/fstKxPD98FgkqzCsVz2LRHCkZn/KCOpT75rX8NijbRIG+KA8nqKf1XsBjhlSJE yT1+pWcIKhCznWNIIf9pg6JBZYvie/uNB6rf8FE/BvpOjuArapfdOmovkHs4Hl07OXdR BBzfTZipNMvVba1Jnf8okf+EDJ1rblQiZppiN5v6wy4oHyjpglbVe+l91OBmmgrPEtY+ sCfA== MIME-Version: 1.0 X-Received: by 10.68.247.6 with SMTP id ya6mr11666176pbc.45.1393722970157; Sat, 01 Mar 2014 17:16:10 -0800 (PST) In-Reply-To: References: <43B63C46-3A2D-4374-8A42-EE931BA9A6C4@cox.net> Date: Sun, 2 Mar 2014 12:16:10 +1100 Subject: Re: Help with "Guess the number" script From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 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: 21 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1393722973 news.xs4all.nl 2829 [2001:888:2000:d::a6]:51417 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:67401 On Sun, Mar 2, 2014 at 12:11 PM, Scott W Dunning wrote: >> print('You got it in ', count, 'guesses.') >> > Thanks Susan! The only problem is he wants us to do it without loops bec= ause we haven=E2=80=99t learned them yet. I need to use the variables and f= unction names that he=E2=80=99s given as well. I think I can make sense of= what you wrote though so that should help me a bit. > Another consideration: Susan's code is written for Python 3, but you seemed to be using Python 2. You'll find that the code won't even run on your version of Python. (If you have the chance, ask if the course writer would consider updating it to use Python 3. There's getting to be less and less reason to use Python 2 for any new projects; when you start a brand new system, you should be using Python 3 unless there's something holding you on the old version. So it's correspondingly more useful to learn Py3.) ChrisA