List Info

Thread: Program for outputing the letter backward




Program for outputing the letter backward
user name
2006-03-29 01:11:25
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 (artificiallystupidyahoo.com)


New Yahoo! Messenger with Voice. Call regular phones from your PC and save big.
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )