Computer Science, asked by yadavmanu387, 4 months ago

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 jai696
1

\huge\red{\mid{\fbox{\tt{Using\: Python\: 3}}\mid}}

rev_arr = lambda arr: arr[::-1]

arr = [1, 2, 3, 4, 5, 6, 7, 8]

print(rev_arr(arr))

\large\mathsf\color{lightgreen}useful?\: \color{white}\longrightarrow\: \color{orange}brainliest!

Similar questions