Please help if you can!

Chris Angelico rosuav at
Thu Dec 27 01:35:23 CET 2012

On Thu, Dec 27, 2012 at 11:04 AM,  <bobflipperdoodle at> wrote:
> Second, I honestly have no idea how to answer your questions.  I am a sophomore in high school and I am trying to learn this on my own because my teacher is not very good at explaining things.

Unfortunately, there are a great many bad programming courses out
there - either because the course material itself is flawed, or
because it's being delivered by someone who isn't good at teaching.
But fortunately, with Python, you don't need a course at all! Check
this out:

You may even be able to work through the tutorial (actually _do_ the
examples, btw) in less time than it would take to solve your problem
by asking here - it takes time to formulate questions, more time to
wait for responses, and then the response may or may not make good
sense to you. It's an excellent tutorial; I strongly recommend it to
people new to Python, whether they're experienced programmers with
other languages or totally new to coding.

> i just cant figure out how to get the total when an order is placed without the customer ordering at least one of each item.  I also can't figure out how to get the shipping to calculate correctly. It is an intro class and we are using just the basics. Most of what Mitya said is stuff I've never seen before, although I am very grateful for her response, I am supposed to use only what the teacher "taught".
> Sorry if I frustrated you.  I'm just a kid trying to learn. Any help is appreciated

The rule that you should use only what you've been taught is a
restriction, and yes, restrictions may feel annoying. But it actually
makes your task easier. Why? Because you have a guarantee (assuming
the course material isn't so fundamentally flawed as to make the task
impossible) that the goal can be achieved with just those tools. You
probably haven't, for instance, been taught about building a dispatch
table using a dictionary and a collection of functions, so you don't
need to worry about coding that way (as an aside, it's a quite viable
way to write something like this).

Once you understand the problem AND understand the tools you're
working with, it's up to you to figure out how to combine your
available tools to solve the problem. That's a fundamental of all
programming and, truth to tell, all of life. But it starts with
understanding both halves, so to that end I think Mitya's post is
quite useful even if the code itself does things you "haven't been
taught". You'll just need to do some code massaging at the end.

Best of luck in the course. Try not to let it scare you off coding -
it's a wonderful world out here, unfathomable powah is unleashed by a
few keystrokes!

import antigravity

More information about the Python-list mailing list