Array in Python | Set 1 (Introduction and Functions)
May 19, 2024
Last Updated : 19 Sep, 2023 (reference: https://www.geeksforgeeks.org/array-python-set-1-introduction-functions/)
Other than some generic containers like lists, Python in its definition can also handle containers with specified data types. The array can be handled in Python by a module named “array“. They can be useful when we have to manipulate only specific data type values.
Properties of Arrays
- Each array element is of the same data type and size. For example: For an array of integers with the int data type, each element of the array will occupy 4 bytes.
- Elements of the array are stored in contiguous memory locations.
Operations on Array in Python
Below are some operations that can be performed in an array:
- append()
- insert()
- pop()
- remove()
- index()
- reverse()