5 ms·
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.
by dangoldin 15y ago
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 15y agoThere is also the top level reversed() function that takes some sequence and returns a reversed iterator.