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

Something else that's interesting is reversing a list but not in place: x[::-1]

The built-in reverse() method will do it in place.



There is also the top level reversed() function that takes some sequence and returns a reversed iterator.




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

Search: