Concantenation and string slicing

DannyB dbough77 at yahoo.com
Thu Feb 23 17:55:16 EST 2006


I've written a program that takes a phrase and spits it back out
backwards.  My problem is it throws each character on a new line.  I'd
like the phrase to be on the same line.  Is this possible?

#Backward Message

message = raw_input("Enter a message:  ")
letter = len(message)
while (letter > 0):
        newMessage = ""
        newMessage += message[letter-1]
        letter -= 1
        print newMessage


Thanks!!

Dan




More information about the Python-list mailing list