Answer to Question #238017 in Python for Upeings

Question #238017
Write a Python program to reverse the order of the items in the array Sample Output: Original array: array('i', [1, 3, -13, 13,2]) reverse array:
1
Expert's answer
2021-09-16T23:43:49-0400
def reverse_arr(list1):
    for i in range(len(list1)):
        list1[i] = list1[len(list1)-i-1]
    return(list1)

reverse_arr([1,3,-13,13,2])

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS