Is there something similar to the slice notation in Python in Scala?
I think this is really a useful operation that should be incorporated in all languages.
See the ScalaAPI here
So not the same notational convenience, but the operation is there
def slice (from: Int, until: Int) : Seq[A]
Selects an interval of elements.
Selects an interval of elements.
Note: c.slice(from, to) is equivalent to (but possibly more efficient than) c.drop(from).take(to - from)
from the index of the first returned element in this sequence. until the index one past the last returned element in this sequence.
returns
a sequence containing the elements starting at index from and extending up to (but not including) index until of this sequence.
definition classes: IterableLike → TraversableLike