A quick question

Chris cwitts at gmail.com
Wed May 28 07:16:57 EDT 2008


On May 28, 12:25 pm, "James" <cobro... at msn.com> wrote:
> Hey everyone,
>
> I just started using python and cant figure this out, I'm trying to
> make a program where someone types in a word and the program gives it
> back backwards.  For example if the person puts in "cat" I want the
> program to give it back as "tac" and what it does is prints out 3,2,1.  
> How can I get these integers to print as letters?  This is what I have,
>
> word = raw_input("Type a word:")
> start = len(word)
>
> for letter in range(start, 0, -1):
>     print letter  

word = raw_input("Type a word:")
print 'Reversed : %s' % word[::-1]



More information about the Python-list mailing list