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


Groups > comp.lang.python > #70211

Re: Learner looking for assistance

From Ben Finney <ben+python@benfinney.id.au>
Subject Re: Learner looking for assistance
Date 2014-04-14 18:11 +1000
References <67147571-4509-4476-bc7b-4712688cf7b1@googlegroups.com>
Newsgroups comp.lang.python
Message-ID <mailman.9240.1397463097.18130.python-list@python.org> (permalink)

Show all headers | View raw


Anthony Smith <jackie.walkabout@gmail.com> 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.

    <URL:http://www.sscce.org/>

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

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


Thread

Learner looking for assistance Anthony Smith <jackie.walkabout@gmail.com> - 2014-04-14 00:43 -0700
  Re: Learner looking for assistance Ben Finney <ben+python@benfinney.id.au> - 2014-04-14 18:11 +1000
  Re: Learner looking for assistance Anthony Smith <jackie.walkabout@gmail.com> - 2014-04-14 01:23 -0700
  Re:Learner looking for assistance Dave Angel <davea@davea.name> - 2014-04-14 08:34 -0400
  Re: Learner looking for assistance Anthony Smith <jackie.walkabout@gmail.com> - 2014-04-15 00:52 -0700
    Re: Learner looking for assistance Chris Angelico <rosuav@gmail.com> - 2014-04-15 18:03 +1000
  Re: Learner looking for assistance Steven D'Aprano <steve@pearwood.info> - 2014-04-15 08:29 +0000
    Re: Learner looking for assistance Anthony Smith <jackie.walkabout@gmail.com> - 2014-04-15 01:44 -0700

csiph-web