Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder7.xlned.com!newsfeed.xs4all.nl!newsfeed3.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.192 X-Spam-Level: * X-Spam-Evidence: '*H*': 0.62; '*S*': 0.01; 'resulting': 0.04; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'finney': 0.16; 'great!': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'not,': 0.20; 'appears': 0.22; 'input': 0.22; 'saying': 0.22; 'header:User-Agent:1': 0.23; 'text,': 0.24; 'post': 0.26; 'header:X-Complaints-To:1': 0.27; 'point': 0.28; 'rest': 0.29; 'gives': 0.31; 'code': 0.31; 'fine,': 0.31; 'writes:': 0.31; 'plain': 0.33; 'problem.': 0.35; 'skip:s 30': 0.35; 'something': 0.35; 'but': 0.35; 'add': 0.35; 'version': 0.36; 'everyone.': 0.36; 'url:org': 0.36; 'too': 0.37; 'ben': 0.38; 'to:addr:python-list': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'enough': 0.39; 'received:org': 0.40; 'even': 0.60; 'skip:u 10': 0.60; 'simple,': 0.60; 'solve': 0.60; 'then,': 0.60; 'free': 0.61; 'simple': 0.61; "you're": 0.61; 'complete': 0.62; 'show': 0.63; 'more': 0.64; 'worth': 0.66; 'here': 0.66; 'lose': 0.68; 'smith': 0.68; 'by.': 0.84; 'copy- paste': 0.84; 'received:125': 0.84; 'understand,': 0.84; 'subject:looking': 0.91; '8bit%:18': 0.93; 'have.': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Ben Finney Subject: Re: Learner looking for assistance Date: Mon, 14 Apr 2014 18:11:19 +1000 References: <67147571-4509-4476-bc7b-4712688cf7b1@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Gmane-NNTP-Posting-Host: jigong.madmonks.org X-Public-Key-ID: 0xBD41714B X-Public-Key-Fingerprint: 9CFE 12B0 791A 4267 887F 520C B7AC 2E51 BD41 714B X-Public-Key-URL: http://www.benfinney.id.au/contact/bfinney-gpg.asc X-Post-From: Ben Finney User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) Cancel-Lock: sha1:UkhAn1Ie+su/UBFuAxizs05PEeI= 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: 35 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1397463097 news.xs4all.nl 2930 [2001:888:2000:d::a6]:46713 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:70211 Anthony Smith writes: > the calc_total does not return a estimated_total_weight > > if add the estimated_total_weight the rest of the code works > > I am at a lose as to why ????? When it's too confusing, simplify. The code you present is fine, but is more complex than it needs to be for the specific problem. Also, it's not complete: it appears to be part of some larger program that we don't have. And, it appears to have suffered re-formatting when you put it in your message, so it won't run. (Post only in plain text, not HTML; and copy-paste the code in plain text.) So: start simple, make something you understand, then gradually build it up until the point where it exhibits the behaviour you're confused by. Then, show that simple-as-possible-but-no-simpler version here, complete with the input you're using and the resulting output. You may find that this process gives you enough understanding that you are then able to solve the problem. Great! But, even if not, we'll need you to go through that process so we can understand. Feel free to post the simple version here if it still leaves you confused. -- \ “Nothing worth saying is inoffensive to everyone. Nothing worth | `\ saying will fail to make you enemies. And nothing worth saying | _o__) will not produce a confrontation.” —Johann Hari, 2011 | Ben Finney