Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder1.xlned.com!newsfeed.xs4all.nl!newsfeed2.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.049 X-Spam-Evidence: '*H*': 0.90; '*S*': 0.00; 'subject:Python': 0.06; 'yeah,': 0.09; 'runs': 0.10; 'python': 0.11; 'corresponds': 0.16; 'docs.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'way;': 0.16; 'sat,': 0.16; 'wrote:': 0.18; 'trying': 0.19; 'programming': 0.22; 'aug': 0.22; 'saying': 0.22; 'error': 0.23; 'subject:Code': 0.24; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'statement': 0.30; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'code': 0.31; 'getting': 0.31; 'easier': 0.31; 'that.': 0.31; 'are.': 0.31; 'with,': 0.31; 'subject:the': 0.34; 'but': 0.35; 'received:google.com': 0.35; 'really': 0.36; 'doing': 0.36; 'step': 0.37; 'to:addr:python-list': 0.38; 'sure': 0.39; 'to:addr:python.org': 0.39; 'even': 0.60; 'read': 0.60; 'problems.': 0.60; "you're": 0.61; "you'll": 0.62; 'miss': 0.74; 'stop,': 0.84; 'subject:else': 0.84; 'exhibiting': 0.91; 'technique': 0.93; '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:to :content-type:content-transfer-encoding; bh=AT6aw1HiNA013VfntOkgAFflx15A/ZnfvI3RrgC2Krg=; b=bX3II7oRC957d8ACCWg4UMKvDMwxyJRqbjLan2LP5xvKFyYrE4Q0tCa5siJVT5ebS6 pGllQLBL0evf22IXMbq7EhHPdQrzR/Yavmvj2ujspurvyLPsmmEiWzySUDcqHCm6Ji5v i7KtHXs8rnuO77gaE4Mb+7lS4on9y54dIIXKE1x2pvOLP7VlBHSjjyjD61VFLT4Ts+a3 EE7iRJwQv0oJwJgWPQhvhmYU+uHtbuUNfEtRwYr1It5DETJMThVhztwLCIjW5/XQiZ6u ltNxjaVmpZC9oICaOAYDnWAHnZNcoDofwauEKq5Z5eO0MKtgb07LOYZeTm41Wo79GRr1 qMOA== MIME-Version: 1.0 X-Received: by 10.59.9.69 with SMTP id dq5mr2823872ved.87.1375494986906; Fri, 02 Aug 2013 18:56:26 -0700 (PDT) In-Reply-To: References: Date: Sat, 3 Aug 2013 02:56:26 +0100 Subject: Re: Python: Code is ignoring the if and else From: Chris Angelico 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 17 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1375494990 news.xs4all.nl 15870 [2001:888:2000:d::a6]:55824 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:51838 On Sat, Aug 3, 2013 at 2:44 AM, wrote: > Yeah, I already know about that. But if I try to change it, I'm not even = able to start the program. If I try to change the if statement that it corr= esponds with, I get a an error saying "card" is not a global. And if I try = to shift it in, for some reason...the program runs through the MISS line mu= ltiple times. Okay. Stop, take a step back, and simplify your problems. You're currently exhibiting a technique of shotgun programming that may be getting in your way; you're just trying things without really knowing what you're doing. Play with individual control structures in interactive Python (eg IDLE), and get to know what's really happening. Read the docs. Be sure you're structuring your code the way you think you are. You'll find everything easier once you understand why your code is doing what it's doing. ChrisA