r()

What does r() do?

r() reverses the array or string inside of it. For example, "Hello" becomes "olleH".

from ArrayExpressions import arrex
lst = [1, 2, 3, 4, 5]
output = arrex.evaluate(lst, "r(x)")
print(output) # [5, 4, 3, 2, 1]

Other Important Information:

InputAny array or string
Does it create a new scope?No
OutputA reversed array/string
KNone
ISame from previous scope
Examplei0(r(x))
Example ExplanationThis returns the last element of x (the base array). Same as doing i{L-1}(x)

iK()

sc()