Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Well, there's always reversed(str) for Python (I realise this returns a reversed object and not a string object, which is something I dislike immensely).

I've always looked at [::-1] as being a bit of a hack, even though we use it all the time for both strings and lists.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: