[Tutor] Python backwards program (fwd)

Danny Yoo dyoo at hkn.eecs.berkeley.edu
Wed Apr 13 22:32:22 CEST 2005


> I cannot write a program that gives me a double letter.
> I can get each letter separate or pieces or parts of the word


Hi Jim,

[Please don't reply just to me: use the Reply-to-All feature on your email
program.  This allows your reply to be seen by the rest of us here.  I
want to make sure your questions won't get lost by my negligence.]


Can you show us what you've tried so far?  That might help us see why
you're running into problems.

The major problem we have in trying to help with this stuff is that we can
not be mind readers: the only channel we can use to see what's going on is
what you show us, and if you don't give us information, we really can't
see what's happening.


So, when you say something like:

> I cannot write a program that gives me a double letter.

then, it's very useful if you can show us what you tried to do, even if it
didn't work.  We really don't care if you get it exactly right: we really
more interested in how you do things: we really want to see how you're
approaching these kinds of problems.


Let's take a hypothetical situation.  If you had shown us something like
this:

######
>>> s = "hello world"
>>> for letter in s:
...     print letterletter
...
Traceback (most recent call last):
  File "<stdin>", line 2, in ?
NameError: name 'letterletter' is not defined
######

that in itself tells us a lot more than "I can't do it."  It's not just an
"error": there's a reason behind it, and that's something we can tackle.

The silly thing that today's education systems have done is to make the
act of making a mistake or error something shameful, so I can see why
you're hesitating to show things to us.  But that's totally wrong: you
need to be willing to show us things that don't work.  A failure itself is
valuable, and we can learn things from them.


Continuing on this idea, when you say:

> I can get each letter separate or pieces or parts of the word

then, show us how you are doing that.  Show us how you are printing each
letter separately.

Seeing what you can do can be as informative to us as seeing what you're
getting stuck on.  Don't be afraid to copy-and-paste programs into your
replies.

I guess I'm trying to say: stop being so shy about sharing your code!
*grin*



More information about the Tutor mailing list