[Tutor] Strings backwards

Danny Yoo dyoo at hkn.eecs.berkeley.edu
Thu Jan 19 02:34:10 CET 2006



On Thu, 19 Jan 2006, Hans Dushanthakumar wrote:

> Try this:
>
> print word[::-1]


Hi Hans and Adam,

Just wanted to point out: next time, let's try to figure out why Ryan had
problems with this, rather than directly give a working answer.

For example, we can ask things like: what part did Ryan get stuck on?
Was it unfamiliarity with the things we can do with slices, or something
else?  What did Ryan try?  What did Ryan look at?  Are there programs that
Ryan has written that are similar to the one he's asking about?

The reason for the caution is this: the reversal question he asked felt
way too much like a homework exercise.  I hate being pedantic, but it is
something we should be thinking about.



More information about the Tutor mailing list