Comment on Python: copying a list the right wayComments−dangoldin14ySomething else that's interesting is reversing a list but not in place: x[::-1]The built-in reverse() method will do it in place.−sdevlin14yThere is also the top level reversed() function that takes some sequence and returns a reversed iterator.
Comments
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.