[Tutor] Program for outputing the letter backward
Johnston Jiaa
artificiallystupid at yahoo.com
Wed Mar 29 03:11:25 CEST 2006
Hoffman,
I am a newbie at python and programming in general so excuse me if I'm wrong. In your example, you had
while index >= index_zero:
which I believe to not be what you intended as you are essentially saying:
while "last letter of vehicle" >= "first letter of vehicle"
"e" is respectively "less than" "v", so that is why your code never executes. You probably mean for the index to actually be the index, not the last letter. "index -= 1" is illegal as the variable points to a string, which can not be subtracted from. Hope I was of help!
Johnston Jiaa (artificiallystupid at yahoo.com)
---------------------------------
New Yahoo! Messenger with Voice. Call regular phones from your PC and save big.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20060328/25d0ce63/attachment.htm
More information about the Tutor
mailing list