What is the array reverse() method in Python?
Overview
An array in python is used to store multiple values of the same datatype in a single variable.
The reverse() function is simply used to reverse the order of the items in a given array.
Syntax
array.reverse()
Parameter value
The reverse() method takes no parameter value.
Return value
The reverse() function returns the reversed array as an output.
Example
# importing the array moduleimport array as arr# creating an integer data type arrayx = arr.array('i', [1,2,3,4,5,6,7])# reversing the arraay using the reverse methodx.reverse()# Printing the reversed arrayprint(x)