Write a function rev_arr() which accepts an array as an argument and
reverses the order of the elements of the array. For example, on execution of
the function rev_arr the array [1, 2, 3, 4, 5, 6, 7, 8]would
be transformed to [8, 7, 6, 5, 4, 3, 2, 1].
Answers
Answered by
1
rev_arr = lambda arr: arr[::-1]
arr = [1, 2, 3, 4, 5, 6, 7, 8]
print(rev_arr(arr))
Similar questions