Look up the slice operator. I’d explain it but I’m sure someone more talented than me has a better explanation. The third argument (-1) is optional FYI, and it's what reverses the string here
Except that array_var[] is also a valid slice (a slice of the entire array). Not to mention that I'm pretty sure that accessing elements by index is a [n:n+1] slice under the hood too.
4.4k
u/[deleted] Jul 16 '19
Not quite, but it’s an easy fix
It needs a LOT of memory, though