Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
dangoldin
on Nov 6, 2011
|
parent
|
context
|
favorite
| on:
Python: copying a list the right way
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.
sdevlin
on Nov 6, 2011
[–]
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:
The built-in reverse() method will do it in place.