Mojo function
reverse
reverse(src: IntTuple[origin]) -> IntTuple
Reverses the order of elements in an IntTuple
, recursively.
This function reverses the top-level elements of the IntTuple
and
recursively reverses any nested IntTuple
s.
Example:
```mojo
from layout import IntTuple
var t = IntTuple(1, 2, (3, 4))
var reversed = reverse(t) # returns ((4, 3), 2, 1)
```
.
```mojo
from layout import IntTuple
var t = IntTuple(1, 2, (3, 4))
var reversed = reverse(t) # returns ((4, 3), 2, 1)
```
.
Args:
- src (
IntTuple[origin]
): The sourceIntTuple
to reverse.
Returns:
A new IntTuple
with elements in reversed order.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!