[Tutor] Beginner question(s)
Michael Sullivan
michael at espersunited.com
Sun Jun 18 15:18:13 CEST 2006
On Sun, 2006-06-18 at 05:58 -0500, Bill Tatum wrote:
> Hi,
>
>
>
> I’m working through Python Programming for the Absolute Beginner. One
> of the challenges at the end of chapter 4 is to get a message from the
> user and then print it out backwards. I have…
>
>
>
> message = raw_input("Enter your message:")
>
> count = len(message)
>
> print count
>
>
>
> which gives me the number of characters in the message. I tried to
> use a for loop:
>
>
>
> for i in range(len(message)-1,-1, -1):
>
> print i,
>
>
>
> but I just get the numeric values of the string. Can anyone help?
>
I'm a python beginner myself, but shouldn't that last "print i" be "print message[i]? As it stands, you're only printing the numeric value 'i'.
-Michael Sullivan-
More information about the Tutor
mailing list