Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Joel Goldstick Newsgroups: comp.lang.python Subject: Re: anyone tell me why my program will not run? Date: Fri, 20 Nov 2015 22:39:22 -0500 Lines: 53 Message-ID: References: <1737402a-2f4d-440a-abd7-6cc500f673e1@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de bNSsjACXzTWHC20qnG36pgITiHaI59O4qiY7uf0VN+ZA== 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; 'else:': 0.03; 'received:209.85.223': 0.03; 'cc:addr:python-list': 0.09; 'subject:why': 0.09; 'python': 0.10; 'subject:not': 0.11; '#this': 0.16; 'doesnt': 0.16; 'email addr:hotmail.com>': 0.16; 'out?': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'subject:program': 0.16; 'subject:run': 0.16; 'wrote:': 0.16; "shouldn't": 0.18; 'tells': 0.18; '2015': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'import': 0.24; 'header:In-Reply- To:1': 0.24; 'fri,': 0.27; 'message-id:@mail.gmail.com': 0.27; 'random': 0.29; 'url:mailman': 0.30; 'anyone': 0.32; 'run': 0.33; 'url:python': 0.33; 'lets': 0.33; 'url:listinfo': 0.34; 'received:google.com': 0.35; 'done': 0.35; 'nov': 0.35; 'but': 0.36; 'url:org': 0.36; 'received:209.85': 0.36; 'subject:?': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'received:209': 0.38; 'skip:p 20': 0.38; 'url:mail': 0.40; 'making': 0.62; 'times': 0.63; '20,': 0.66; 'here': 0.66; '100': 0.79; 'riley': 0.84; 'subject:tell': 0.84; 'tasked': 0.84; 'joel': 0.91; 'lucky': 0.93; 'to:addr:hotmail.com': 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:to :cc:content-type; bh=aAYONcbFnd+nkVs8+1SAG6Fzgyx4qLlJIhekU5cE/hw=; b=F2E+TpaleQWuN3VnlStfRnKkFEmr6SZS24JaP9cVFWVnhH5ezmdV+2jyJVw0MBZT83 73S9cIv/9mQuexn+7W8X4uco/oGce7Sd2X7VEki81I+z4UneymkxGQXCRb7xhLpKDsaQ PhlbHr/wkiD/77n0sFujTY7ExGsqUdwnT3/ZEp/ogad5p5EA6GJbj+5Xli89SH5ljOKf wNEH2WYCMbhY3wGAxo/vlEH+PT1XicU4ne/24kRU8FB1skzguOyoZ6h9r4BrHAnXhFU9 zw6FnxB84MTjRbgIFlYNdaUh0RmxkMdbFJtmhlSk1Dgms/LlqIQ9w959ZOdrvlX6Jfx1 ovSA== X-Received: by 10.107.30.80 with SMTP id e77mr16922027ioe.180.1448077162439; Fri, 20 Nov 2015 19:39:22 -0800 (PST) In-Reply-To: <1737402a-2f4d-440a-abd7-6cc500f673e1@googlegroups.com> X-Content-Filtered-By: Mailman/MimeDel 2.1.20+ X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:99194 On Fri, Nov 20, 2015 at 10:30 PM, Dylan Riley wrote: > i am learning python and was tasked with making a program that flips a > coin 100 times and then tells you > the number of heads and tails. > > I have done so coming up with this piece of work but it doesnt run can > anyone help me out? > > #This is credited to dylan > > print(" \\ \\ \\ \\ \\ \\ \\ \\ D FLIPS \\ \\ \\ \\ \\ \\ \\ \\") > print("\n\nThis is D's coin flipper program. You get 100 flips. \n\t LETS > SEE HOW LUCKY YOU ARE") > input("Press enter") > > import random > > heads = int("1") > tails = int("2") > flips = 100 > headscount = 0 > tailscount = 0 > > while flips != 0: > flips -= 1 > > shouldn't this below be in the while loop? > result = random.randint(heads, tails) > if result = heads: > headscount += 1 > else: > tailscount += 1 > > > up to here > print(headscount, tailscount) > > input("press enter to exit") > -- > https://mail.python.org/mailman/listinfo/python-list > -- Joel Goldstick http://joelgoldstick.com/stats/birthdays