array[ index ]
array[ start_index , end_index ]
Argument
| Description
|
---|---|
array
| Array data type. The array from which you want to access one or more elements.
You can enter any valid expression that evaluates to an array.
|
index
| Integer data type. The position of the element that you want to access. For example, an index of 0 indicates the first element in an array.
|
start_index
| Integer data type. The starting index in a range of elements that you want to access. The subscript operator includes the element that the starting index represents.
|
end_index
| Integer data type. The ending index in a range of elements that you want to access. The subscript operator excludes the element that the ending index represents.
|
drinks = [‘milk’, ‘coffee’, ‘tea’, ‘chai’]
|
|
---|---|
|
|
|
|
|
|
|
|
|
|
|
|