Python Arrays
- An array is a collection of elements that are stored in contiguous memory locations.
- An array holds fixed number of elements of the same data types.
- An array can store multiple elements of the same data types.
- An array is used to store multiple values in single variable.
e.g.
arr_val1="horse"
arr_val2="lion"
arr_val3="man"
- An array in python can be handled a module named array
e.g.
import array as aar
Representation of array:-
An array can be declared in different ways and different languages.Here We are going to declared the array in python language.
- Python array starts with 0 index.
- Python array's elements can be accessed via its index.
- The length of an array = total number of index+1.