Reversing a string

ptn tn.pablo at gmail.com
Wed Jun 27 22:04:58 EDT 2007


>
> or one letter per line:
>
> >>> print "\n".join("spam"[::-1])
>
> m
> a
> p
> s
>

One liners rock ;)




More information about the Python-list mailing list