#slicing

[ follow ]
fromPythonmorsels
1 week ago

Looping in reverse

To loop in the reverse direction, you can use Python's built-in reversed function, which is more readable and flexible than slicing syntax for iterables.
Python
fromHackernoon
3 weeks ago

This Tiny Rust Tweak Makes Searching a Slice 9x Faster | HackerNoon

Rust does not provide a built-in method to find the position of an element in a slice, but this can be implemented easily and efficiently.
Scala
[ Load more ]