Computer Science, asked by kalyanivas, 10 months ago

if array A has elements (1,2,3),then revers of the array A will be (3,2,1),and the resultant array should be (4,4,4)​

Answers

Answered by sankarnuti
0

Answer:

# Defining a function to reverse elements of a list/array

def Reverse(lst):

   return [ele for ele in reversed(lst)]

     

# Driver Code

lst = [1,2,3]

# Applying Reverse function on the list

reverse_lst = Reverse(lst)

# Creating a final list and applying a lambda function to sum both the above lists

final_lst = [sum(x) for x in zip(lst, reverse_lst)]

# Printing the Final List

print(final_lst)

Explanation:

The code written above is in python language.

Similar questions