Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #43262

Re: guessthenumber print games left

Path csiph.com!usenet.pasdenom.info!news.etla.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.121
X-Spam-Level *
X-Spam-Evidence '*H*': 0.76; '*S*': 0.00; 'that?': 0.05; 'counting': 0.09; 'python': 0.11; 'assistance!': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'left,': 0.16; 'subject:games': 0.16; 'subtract': 0.16; 'wrote:': 0.18; 'variable': 0.18; 'wed,': 0.18; 'second': 0.26; 'header:In-Reply- To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'anyone': 0.31; 'figure': 0.32; 'up.': 0.33; 'guess': 0.33; 'totally': 0.33; 'could': 0.34; 'received:209.85': 0.35; 'problem.': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'thanks': 0.36; 'example,': 0.37; 'received:209': 0.37; 'solving': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'how': 0.40; 'number,': 0.60; 'tell': 0.60; 'new': 0.61; 'first': 0.61; "you'll": 0.62; 'skip:n 10': 0.64; 'more': 0.64; 'total': 0.65; 'p.s.': 0.66; 'here': 0.66; 'off,': 0.84; 'subject:skip:g 10': 0.84; 'hopes': 0.91; '2013': 0.98
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type:content-transfer-encoding; bh=cuy7e1pjuQxMgMLF8jdqu85jr18P88XboabKq3XYhi8=; b=kN6ZoOmQxu4q+61HSAs/pI6WqXdvRhmGFEKtSL9gxonDY8KfsegKcyarK0+kiAti01 1DLKFbYh1sHGk6fc+nw/wAtVg46jXj7ax5x0wtOgWAQR6l5RY/HajxSm22qRJ9sS0Yws c0Z5dIAoEB9IUOYbrhVw5r6260xfthlLvZsuWzh6eURx31mOIKtRN3Nsdmed2n2AtSZk RZumC9MrMUX8GMcLueyixIwPsU0E8PQTckTrsWgbpv79iyNPTISbKsS3IxWCfdrEHOVJ i8l+d3/qrI9J3WkkDFKBdKAAVlFkddEWox23c4IUb3kmp1t4PL3+o5ra/9CIzIhc+dNo z7CA==
MIME-Version 1.0
X-Received by 10.52.97.8 with SMTP id dw8mr717358vdb.91.1365587061015; Wed, 10 Apr 2013 02:44:21 -0700 (PDT)
In-Reply-To <0e8b4a09-3d1d-4b92-a0ef-2274a2a651c9@googlegroups.com>
References <0e8b4a09-3d1d-4b92-a0ef-2274a2a651c9@googlegroups.com>
Date Wed, 10 Apr 2013 19:44:20 +1000
Subject Re: guessthenumber print games left
From Chris Angelico <rosuav@gmail.com>
To 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 <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.403.1365587062.3114.python-list@python.org> (permalink)
Lines 20
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1365587062 news.xs4all.nl 2643 [2001:888:2000:d::a6]:38124
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:43262

Show key headers only | View raw


On Wed, Apr 10, 2013 at 7:39 PM,  <eschneider92@comcast.net> wrote:
> Could anyone tell me how to make the program tell me how many games are left before the first game and second game? For example, after one game of guess the number, I want it to tell me that i get one more game. P.S. I'm totally new to python (obviously), and I just added numberofgames variable in hopes of solving this problem. am I on the right track? Thanks for any assistance!

> numberofgames=1
> while numberofgames<4:
>     numberofgames=numberofgames+2

First off, why are you adding two? Is this a typo?

You have here a counter, but it's counting up. To figure out how many
games are left, just subtract the numberofgames from the total number
of games that you'll be allowing - that's how many there are left. Do
you know how to do that?

ChrisA

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

guessthenumber print games left eschneider92@comcast.net - 2013-04-10 02:39 -0700
  Re: guessthenumber print games left Chris Angelico <rosuav@gmail.com> - 2013-04-10 19:44 +1000
    Re: guessthenumber print games left eschneider92@comcast.net - 2013-04-10 14:01 -0700
      Re: guessthenumber print games left Chris Angelico <rosuav@gmail.com> - 2013-04-11 08:31 +1000
    Re: guessthenumber print games left eschneider92@comcast.net - 2013-04-10 14:01 -0700
  Re: guessthenumber print games left eschneider92@comcast.net - 2013-04-10 22:34 -0700
  Re: guessthenumber print games left eschneider92@comcast.net - 2013-04-10 22:41 -0700
    Re: guessthenumber print games left Chris Angelico <rosuav@gmail.com> - 2013-04-11 15:48 +1000
  Re: guessthenumber print games left eschneider92@comcast.net - 2013-04-10 22:56 -0700
    Re: guessthenumber print games left Chris Angelico <rosuav@gmail.com> - 2013-04-11 16:02 +1000
  Re: guessthenumber print games left eschneider92@comcast.net - 2013-04-10 23:15 -0700
    Re: guessthenumber print games left Chris Angelico <rosuav@gmail.com> - 2013-04-11 16:27 +1000
  Re: guessthenumber print games left eschneider92@comcast.net - 2013-04-11 00:15 -0700
    Re: guessthenumber print games left Chris Angelico <rosuav@gmail.com> - 2013-04-11 17:27 +1000
    Re: guessthenumber print games left Neil Cerutti <neilc@norwich.edu> - 2013-04-11 12:31 +0000

csiph-web